rest2web-develop Mailing List for rest2web (Page 27)
Brought to you by:
mjfoord
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(74) |
Aug
(71) |
Sep
(6) |
Oct
(6) |
Nov
(3) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(8) |
Feb
(17) |
Mar
(16) |
Apr
(48) |
May
(9) |
Jun
|
Jul
(7) |
Aug
(93) |
Sep
(18) |
Oct
(17) |
Nov
(22) |
Dec
(11) |
2007 |
Jan
(11) |
Feb
|
Mar
(61) |
Apr
(14) |
May
(3) |
Jun
|
Jul
(13) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2008 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(2) |
Nov
(7) |
Dec
(7) |
2009 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2010 |
Jan
(1) |
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(14) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2016 |
Jan
(2) |
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael F. <mi...@pc...> - 2005-07-07 11:07:44
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nicola Larosa wrote: [snip..] > >>>I've added a ``SimpleVal`` object for doing dummy validation (achieves >>>the same thing as the old 'partial configspec' - just checks members are >>>present). >>> >>>I've added your iter methods into Section - so that it behaves minor an >>>ordered dicitonary. A couple of slight changes you might want to use in >>>odict - I use ``repr`` rather than ``str`` in the ``__repr__`` method, >>>and ``popitem`` is also ordered. > > > Rewrote __repr__, I like it better like this: > > def __repr__(self): > items = [] > for key in self._keys: > items.append('%s: %s' % ( > repr(key), repr(self[key]))) > return '{%s}' % ', '.join(items) > Yeah that's nicer. > > >>>I've also started on the ``writein`` method - which will be a bit tricky >>>to get right, but I think I know how I'll do it. >>> >>>If you get a chance - can you look at the ``TODO`` and ``ISSUES`` >>>section, and any questions in the source ! > > > That's next in line. :-) Let's switch all dev discussion to the > rest2web-dev ML, I'm subscribed now. > Done :-) I'll list the questions I have, answer any you can be bothered with :-) 1) Part of the point of ConfigObj is that you can create config files from a program. Something like : config = ConfigObj() config.filename = 'new.ini' config['member1'] = value1 config['section1'] = {} config['section1']['member1'] = value1 ... config.write() As it is to be written to a file - the only valid values to set are strings, lists of strings, or dictionaries (containing strings or lists of strings or...). Should we do type checking when the value is set ? (not very difficult). This means the error would be raised when you *set the value*, rather than when you try to write the file - which may be another part of the program. In ConfigObj 3 type checking was optional. There was also a ``stringify`` option. If set this automatically converts all values to strings when writing. (So you can just assign integers etc without having to do conversion yourself !). My preference is to do type checking and no longer provide the stringify option. 2) Also in ConfigObj 3 - you could assign a new value to None - and it would initialise the value to an empty section. You now do this with an empty dictionary (which also worked in ConfigObj 3). I'm opting to lose the option of setting a value to None to initialise it. 3) ConfigObj 3 allowed multiline comments of the \*.....*\ variety. Shall I reimplement this ? 4) ConfigObj 3 also preserved the comment at the start and end of a file. These would be written out by the ``write`` method. 5) Should I attempt to preserve the amount of whitespace around the divider, the type of quoting used, and the amount of whitespace before the comment - and then re-use it in the write method ? I'd rather not.... 6) ConfigParser and ConfigObj allow some recursion in string interpolation - a replaced value can also contain a value to replace. This can be useful. In ConfigParser, you get a `Max recursion depth exceeded' error if you get stuck in a loop. ConfigObj just ignores it. Should it raise the error ? (I think it *should*) 7) In ConfigObj 3 you could specify the encoding of the file being read and it would decode to unicode *before parsing*. I've removed support for this and added ``decode`` and ``encode`` methods to convert to and from unicode after parsing/before writing. This means you can only use ascii compatible encodings in config files. Adding full unicode support is possible - but requires the addition of two extra keywords (encoding and backup_encoding). Seeing as UTF8 is a full unicode, ASCII compatible encoding - I see no need to change yet. That will do for the moment..... > > >>>There are a couple of >>>implementation decisions still to be made. e.g. should I prefix the >>>private methods with a double underscore ? > > > Single underscore is enough, I'd say. > Ok - I'll start that. I've now added ``__all__`` and ``Section`` is not a public object. > > >>>Once I've written ``writein`` - I'll preserve comments. I think I'll do >>>this using a comments attribute for each section. I'm going to start by >>>just preserving inline comments - you can preserve comments *above* a >>>member by using the ``writein`` method ! Once these two features are >>>done then it will basically be ready. Just the documentation ! > > > Are the docs for ConfigObj3, if any, still applicable, at least partially? > Probably large chunks are still applicable, but it *all* needs rewriting. The ``validate.Validator`` class is poorly documented (and I *didn't* write the example functions !). > > >>>By the way - sending encrypted mail makes it difficult (not impossible) >>>for me to receive mail at home (I use the PDA). When I leave on >>>Saturday, it will make it impossible ! > > > Then I'll revert to signing only, not may big secrets to protect anyway. ;-) > :-) Not yet. Regards, Fuzzy http://www.voidspace.org.uk/python > > -- > Nicola Larosa - ni...@te... > > Adding things just because you can leads to monstrosities like Common LISP, > PL/I, Algol 68 and Perl 6. Adding features only when they add functionality > (or better yet, by removing restrictions) leads to jewels like Python, > Scheme and Eiffel. -- Mike Meyer, comp.lang.python, April 2005 > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCzQz359Olk6wiv6IRAmkSAJ4l6ek5d2Yy7hWvshA8gUgZ+uo+2QCdETmY UY1iW7V2i5nvZyIskgOaDv4= =AZga -----END PGP SIGNATURE----- |
From: Nicola L. <ni...@te...> - 2005-07-06 22:59:45
|
Ehi, time to liven up this place a bit, don't you think? :-) -- Nicola Larosa - ni...@te... Confidence is easy, if you ignore enough of what's around you. -- Arthur J. Siegel, April 2005 |
From: Michael F. <mi...@pc...> - 2005-06-29 08:43:46
|
Hello all, rest2web 0.3.0 is now up on Sourceforge at last. The code has been refactored for readability - although it's possible there's more that could be done. The directories are walked through by ``Processor.walk()`` and the methods ``setdefaults``, ``process``, ``processindex``, and ``buildsection`` are called in turn. I've looked at building a windoze executable, using py2exe. It shouldn't be too difficult - but because of the way imports are done from the macros it's *non-trivial*. I will look at it again later. The next issues are tagging (allowing a non-hierarchical structuring of a site), and sitemaps. The uservalues support for multiple translations might need work - I'll wait for user feedback before I do any more on it. Best Regards, Fuzzy http://www.voidspace.org.uk/python/rest2web |