Hello, compatriota. :)
On Tuesday December 2, 2008 15:53:42 [EMAIL PROTECTED] wrote:
I've been working in a repoze.what plugin that uses INI-like files as data
sources. You can download v.0.1 from:
http://reduc.uc.edu.ve/intranet/tmp/repoze.bfg/repoze.what.plugins.inifile/
view
The file format is:
[section]
item
item
...
I've just checked the code and it looks nice. :)
If someone could mentor me to make it production grade quality and release
it officially, I'll apreciate it.
Count on me.
My comments according to what I found:
1.- For this plugin, I think you don't need the configure_INI_adapters()
utility.
2.- Please provide us with the full source, so that we can check other
things. Python eggs don't ship with setup.py, for example.
3.- Please write a text suite with testutil to make sure it works as you
expect. It's very easy:
I.- Create an ini file to test the Ini group source adapter. It may look
like this:
[admins]
rms
[developers]
rms
linus
[trolls]
sballmer
[python]
[php]
II.- Create an ini file to test the Ini permission source adapter. It may
look like this:
[see-site]
trolls
[edit-site]
admins
developers
[commit]
developers
III.- Have repoze.what's testutil to verify your plugin automatically [1].
You may dive into the test suite for the SQL plugin for an example. For
example, the test case for the group adapter may look like this (not tested,
but should work):
from repoze.what.adapters.testutil import GroupsAdapterTester
class TestGroupsAdapterTester(GroupsAdapterTester, unittest.TestCase):
def setUp(self):
super(TestGroupsAdapterTester, self).setUp()
current_dir = os.path.abspath(os.path.dirname(__file__))
fake_groups = os.path.join(current_dir, 'groups.ini')
self.adapter = INIGroupAdapter(fake_groups)
4.- In INIFileAdapter, the repoze.what's SourceError exception [2] is better
suitable instead of NotImplementedError. This is what users would expect to be
raised; NotImplementedError would catch them unaware.
5.- Finally, a minor cosmetic suggestion: Possibly ini is a better name for
the plugin because it's shorter. I'm afraid this will be the only Ini-based
plugin, and if not, you came up first :) . Anyway, it's a minor issue and it's
up to you.
Please don't hesitate to get back with more questions. I'll be glad to help =)
Saludos!
[1] http://static.repoze.org/whatdocs/Manual/ManagingSources.html#module-
repoze.what.adapters.testutil
[2]
http://static.repoze.org/whatdocs/Manual/ManagingSources.html#repoze.what.adapters.SourceError
PS: Are you planning on enabling write
--
Gustavo Narea http://gustavonarea.net/.
Get rid of unethical constraints! Get freedomware:
http://www.getgnulinux.org/
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev