rest2web-develop Mailing List for rest2web (Page 24)
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: Nicola L. <ni...@te...> - 2005-08-04 06:15:20
|
> I've decided to scrap the writein method for ConfigObj - and instead > preserve comments above keywords. > > I intend to preserve inline comments as well - so each Section will have > an ``inline_comments`` and a ``comments`` dictionary attached. Each > member of ``comments`` will be a *list* of comment lines. I can do this > with minor changes to the current implementation. > > The file format will look like : > > # initial_comment > # preserved > > # lost > > # preserved with section marker > [section] # also preserved > # lost > > # preserved with key > Key = value # also preserved > # lost > > # final_comment > # preserved > > > What do you think ? I think that's great. I didn't quite like the idea of interspersing changes in an already existing file. This way, the user does not have to worry which write method has to be used. The loss of isolated comment lines is unfortunate, and seems a rather arbitrary thing to do, from the user point of view. But these drawbacks are surely minor, and the gained simplicity is worth them. Maybe they could be alleviated by emitting some kind of warning during file parsing. -- Nicola Larosa - ni...@te... If there are a few shark attacks in Florida - and a graphic movie - suddenly every swimmer is worried. More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier, May 2005 |
From: Michael F. <mi...@pc...> - 2005-08-03 22:50:44
|
Hello Nico, I've decided to scrap the writein method for ConfigObj - and instead preserve comments above keywords. I intend to preserve inline comments as well - so each Section will have an ``inline_comments`` and a ``comments`` dictionary attached. Each member of ``comments`` will be a *list* of comment lines. I can do this with minor changes to the current implementation. The file format will look like : # initial_comment # preserved # lost # preserved with section marker [section] # also preserved # lost # preserved with key Key = value # also preserved # lost # final_comment # preserved What do you think ? |
From: Michael F. <mi...@pc...> - 2005-08-01 10:47:40
|
Hello Nicola, At some point we ought to move all the pythonutils modules into the 'branches' directory and assess their worth. I'd like to keep caseless and listquote in there even though they're not used by ConfigObj (they do get some use). I'd like to add urlpath from rest2web and also your ordered dictionary (with a few amendments - I'd like to use it within rest2web). (The reason for adding urlpath is so that my gallery can run as a standalone app. without having to depend on rest2web - just pythonutils). Obviously your name needs to be properly added to the credits. __init__.py also needs sorting. I've deleted the plugins branch (possibly wrong - should have just been the files). The gallery now works (still a TODO list) - so I'm adding it, with test files etc. to the main distribution. It has a *separate* test site because it requires PIL to work. I'll resolve *some* of the TODO list and do some more work on the plugin system (I've only implemented enough for the gallery to work) in preparation for a new release. I'm adding files to help build the distribution, and also to create a standalone executable (not yet working - path issues to resolve). Best Regards, Fuzzy http://www.voidspace.org.uk/python |
From: Nicola L. <ni...@te...> - 2005-07-31 06:04:44
|
> I haven't had a chance to fully asses your changes yet. I'm sure they're > good though. > > Is it alright for me to start work on the unfinished bits ? Yes, go ahead. I'd like to discuss a few open issues with you, until then I'm not going to work on ConfigObj. -- Nicola Larosa - ni...@te... What's exciting to me about computers is it's an area where humans, notorious for not getting along, especially politically and religiously, have co-created some awesomely complicated yet working technology. It's a metaphor for civilization itself. -- Kirby Urner, May 2005 |
From: Michael F. <mi...@pc...> - 2005-07-30 22:46:53
|
Hello Nicola, I haven't had a chance to fully asses your changes yet. I'm sure they're good though. Is it alright for me to start work on the unfinished bits ? Regards, Fuzzy -----Original Message----- >From: "Nicola Larosa"<ni...@te...> >Sent: 29/07/05 22:36:30 >To: "res...@li..."<res...@li...> >Subject: [Rest2web-develop] New config file format for ConfigObj 4 > >Everybody out there incautiously using alpha software, beware! ;-) > >With the last commit, the config file format used by ConfigObj 4 changed. > >Indentation is not significant anymore. Subsections are now designated by >repeating the square brackets. Full details in the docs directory of the >branch. > >The change is rather massive, 2500 lines of diff in both code and docs. >Tests all pass, should something be broken anyway, let me know. > >-- >Nicola Larosa - ni...@te... > >What's exciting to me about computers is it's an area where humans, >notorious for not getting along, especially politically and religiously, >have co-created some awesomely complicated yet working technology. It's >a metaphor for civilization itself. -- Kirby Urner, May 2005 > > > >------------------------------------------------------- >SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >from IBM. Find simple to follow Roadmaps, straightforward articles, >informative Webcasts and more! Get everything you need to get up to >speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >_______________________________________________ >Rest2web-develop mailing list >Res...@li... >https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |
From: Michael F. <mi...@pc...> - 2005-07-30 10:56:15
|
Wow - this is some monolithic change ! I've downloaded it with my new XDA IIi, and will explore it tonight. There's still a bit to do - I have improvements in mind for the errors and validation - but particularly the ``writein`` method. We're nearly there for a first release though. We could do with (sometime) evaluating the other modules in the pythonutils suite. Anyway - nice one, well done Nicola. Regards, Fuzzy -----Original Message----- From: "Nicola Larosa"<ni...@te...> Sent: 29/07/05 22:36:30 To: "res...@li..."<res...@li...> Subject: [Rest2web-develop] New config file format for ConfigObj 4 Everybody out there incautiously using alpha software, beware! ;-) With the last commit, the config file format used by ConfigObj 4 changed. Indentation is not significant anymore. Subsections are now designated by repeating the square brackets. Full details in the docs directory of the branch. The change is rather massive, 2500 lines of diff in both code and docs. Tests all pass, should something be broken anyway, let me know. -- Nicola Larosa - ni...@te... What's exciting to me about computers is it's an area where humans, notorious for not getting along, especially politically and religiously, have co-created some awesomely complicated yet working technology. It's a metaphor for civilization itself. -- Kirby Urner, May 2005 ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Rest2web-develop mailing list Res...@li... https://lists.sourceforge.net/lists/listinfo/rest2web-develop |
From: Nicola L. <ni...@te...> - 2005-07-29 21:36:36
|
Everybody out there incautiously using alpha software, beware! ;-) With the last commit, the config file format used by ConfigObj 4 changed. Indentation is not significant anymore. Subsections are now designated by repeating the square brackets. Full details in the docs directory of the branch. The change is rather massive, 2500 lines of diff in both code and docs. Tests all pass, should something be broken anyway, let me know. -- Nicola Larosa - ni...@te... What's exciting to me about computers is it's an area where humans, notorious for not getting along, especially politically and religiously, have co-created some awesomely complicated yet working technology. It's a metaphor for civilization itself. -- Kirby Urner, May 2005 |
From: Nicola L. <ni...@te...> - 2005-07-27 04:53:34
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > The guys who are using ConfigObj from SVN are happy to lose significant > indentation. They ask if it will be possible to ignore whitespace > between the brackets marking a section. > > This means the regex will have to look a bit more like (off the top of > my head) : > > \s*((?:[\s*)+)(.*)((?:\s*\])+)\s*(#.*)? > > and then you'll have to count square brackets rather than just matching > lengths ! I had actually thought of this, but was going to discard the idea. :-) It's good when use cases match one's intuition. B-D Ok, I'll do it this way. In the mean time, those guys could do worse than subscribing to this mailing list. They're using alpha software, after all. It's good that we have early users, mind you, I speak in their own interest. :-) Having them on board means even more attention to not breaking anything with *each one* commit. I was already careful with that, but now it's paramount. Tests are vital for this, obviously. If something breaks anyway, it would be better if there's a direct communication channel between me and them, at this point. I'll need to warn them when the config format actually changes, and they'd need to alert me of any problems, without making you the postman-in-the-middle, possibly. :-) - -- Nicola Larosa - ni...@te... Programming without a lot of ego is another way of stating the goal. Don't be so attached to your code that the idea of other people improving/changing it drives you crazy. You should *want* them to do that. -- Kirby Urner, May 2005 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFC5xM+Xv0hgDImBm4RAkZUAKCEoWqlsJ0h/apJHK66cgltRJ+GTQCggN0h +cxwTLTWZfIIYkTrjM0VRbg= =RaP8 -----END PGP SIGNATURE----- |
From: Michael F. <mi...@pc...> - 2005-07-26 15:57:12
|
Hello Nicola, The guys who are using ConfigObj from SVN are happy to lose significant indentation. They ask if it will be possible to ignore whitespace between the brackets marking a section. This means the regex will have to look a bit more like (off the top of my head) : \s*((?:[\s*)+)(.*)((?:\s*\])+)\s*(#.*)? and then you'll have to count square brackets rather than just matching lengths ! Hope this is useful. Best Regards, Fuzzy http://www.voidspace.org.uk/python |
From: Nicola L. <ni...@te...> - 2005-07-26 11:23:51
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > It would be nice to get ConfigObj 4 finished. Yes, it would. :-) I hope being able to work on it tomorrow. > I guess a substantial part > of moving away from indentation is that the tests and docs will need > re-writing as well *sigh*. Are you going to do that as well ? I surely will. > I had an email yesterday from a couple of folk using the current > version. I've let them know it's about to change ! Good, *if* the current version you refer to is actually ConfigObj *3*. :-) > Anyway - as for how to do the change, it should be quite easy. [snip] Thanks for your explanation, it will definitely make my job easier. > Those changes should actually be quite minor... changing the tests and > documentation is a bit more laborious as I put quite a bit of work into > these. Yes, but it's mostly grunt work, and I'm good at that too. ;-) - -- Nicola Larosa - ni...@te... Perl: you shoot yourself in the foot, but can't figure out how you did it so you find a dozen new ways to do it. Python: you shoot yourself in the foot and everything goes so smoothly that you go ahead to shoot yourself in the other foot then your legs, then your torso and then your head. Problem solved. -- http://linux.sgms-centre.com/howto/shootfoot.php , October 2003 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFC5h07Xv0hgDImBm4RAojnAKCTr130gWFCI9M9RsrH4/aZK/8x4ACguv7M SSRC0V6NieG8Czf8tzQXwOo= =2yXz -----END PGP SIGNATURE----- |
From: Michael F. <mi...@pc...> - 2005-07-26 09:14:47
|
Hello Nicola, It would be nice to get ConfigObj 4 finished. I guess a substantial part of moving away from indentation is that the tests and docs will need re-writing as well *sigh*. Are you going to do that as well ? I had an email yesterday from a couple of folk using the current version. I've let them know it's about to change ! Anyway - as for how to do the change, it should be quite easy. The current regex that checks for a section marker looks *something* like (simplified) : (\s*)\[(.*)\]\s*(#.*)? The first group is the indentation, the second is the section-name, the third is the comment. It can change to (simplified) : \s*(\[)+(.*)(\])+\s*(#.*)? First group is the number of open square brackets, second is the section-name, third is the number of close brackets, fourth is the comment. Just check that the length of the first group is the same as the length of the second group and that gives you the depth of the section being created. (Root section is depth 0). So instead of an indent attribute - each section has a depth attribute. If the new section has a lower depth - you just step up until you find the right parent (depth of one less than the new one). Each section could even have a list of it's parents - so you find the right parent by indexing the list. Obviously a new section can have a *maximum depth* of one more than the current section. You'll need a new 'indent_type' option - which should map to an attribute on the ConfigObj. This should default to ' ', and allowed values are ' ', '\t', or None ('' ?). This only refers to how the ConfigObj is written back out again. (So the write methods need to use it). Those changes should actually be quite minor... changing the tests and documentation is a bit more laborious as I put quite a bit of work into these. All the best. Fuzzy |
From: Michael F. <mi...@pc...> - 2005-07-25 07:30:52
|
Hello Dirk, Can you use SVN ? The latest version now has three fixes : ``minibar`` function now follows the section-list order. Fixed bug where ``thispage`` could be ``None``. Added a tags keyword. The ``thispage`` problem was indeed a bug. My original implementation (that found ``thispage`` in the indextree structure) was a bit of a hack that appeared to work fine. These things always come back to bite you. It appears to work better now ;-) I've also changed the ``minibar`` function to follow the order of sections specified. I haven't yet implemented a way of specifying the page order. My favoured way of doing this is turning the indextree into an ordered dictionary - but I haven't yet implemented it ! I'd like a solution that also works for the ``sidebar`` function. Best Regards, Fuzzyman Dirk Steenpass wrote: >Dear Fuzzyman, > >thanks for your quick reply and apologies for my late answer. > >I see the point of not specifying everything because pages are generated >dynamically. I could use templates for pages when I want an ordered >sidebar menue. However, I'm a lazy guy and I would like to get away >using as few templates as possible. I am thinking about introducing an >additional restindex variable 'page-order', that get's evaluated if >present. Similar to 'section-list' 'page-order' has a meaning on index >pages only. I will probably take a look into this tomorrow ... > > >The 'thispage' question: I tried to say the following: > >root_dir/ > index_page <- thispage != None > > subdir/ > index_page <- thispage != None > page_1 > page_2 > > subdir/ > index_page <- thispage == None > >In words: the 'thispage' variable is None for index pages that are leaves >of the indextree. As index pages are treated special several times I was >wondering whether this is a bug or a feature. > >best regards, dirk > > >On Sun, Jul 10, 2005 at 08:26:15AM -0700, root wrote: > > >>>On Sun, 10 Jul 2005 01:20:43 0200 Dirk Steenpass <ste...@sd...> >>> >>> >>wrote. >> >> >>>Dear Mr. Foord, >>> >>>I have recently discovered rest2web (via ReStructuredText >>>documentation). I really like the rest2web idea, as I am sick of >>>writing plain html and a full blown content managment is an overkill for >>>my needs. >>> >>>I would like to bother you with a few questions about rest2web 0.3.0 >>>hoping that your answers save me from code diving ;-). >>> >>> >>> >>> >>Hello Dirk, >> >>I'm glad that you might find rest2web helpful - and I'd be very pleased to >>answer your questions about it. >> >>I'm away in Romania for the next week - so some of your questions I might >>have to investigate when I return. >> >> >> >>>When using minibar, is there a way to control the order of pages within >>>a section? >>> >>> >>>When using minibar, is there a way to control the order of sections? It >>>seems that the order of section specifications is not honored? >>> >>> >>> >>Not currently - although honouring the order they are specified in seems a >>very sensible idea. You can see the code in the minibar function in (I >>think) the file ``functions.py``. >> >>The reason I didn't add too much code to specify the position of everything >>is that it's supposed to be dynamic - you're supposed to be able to add >>whole sections *without* having to specify where they go. Otherwise you >>might as well just put the links in the template yourself ! >> >>However - your idea is a good one. When I can look at implementing it. It >>should be quite easy. >> >> >> >>>The 'thispage' value is not None for every page that is build, with the >>>exception of index pages that are leafs of the indextree. Is this is a >>>bug or a feature? >>> >>> >>> >>I don't fully understand the question - and I'm not able to test. 'thispage' >>*shouldn't* be None as it's a pointer to the current page in the 'indextree' >>structure. >> >>Are you saying that I document it as being None - or that *sometimes* it is >>None ? >> >>Best Regards, >> >>Fuzzyman >> >> >> >> >> >> >>> >>>bis denn, dirk >>> >>> >>> >>> > > > |
From: Michael F. <mi...@pc...> - 2005-07-24 08:49:28
|
Hello Nicola, Looks interesting - although very debian specific of course. Interesting = that a mathmetician invented tagging in the 1930s ! I've already implemented a 'tags' keyword for rest2web. I'm now working = on a 'plugin' system that will allow me to add a gallery, sitemap = builder (conventional), and an interface to tags. All the best, Fuzzy -----Original Message----- >From: "Nicola Larosa"<ni...@te...> >Sent: 23/07/05 23:29:04 >To: = "res...@li..."<res...@li...urcefor= ge.net> >Subject: [Rest2web-develop] Debian? Tags? Ranganathan? >Can't believe what appeared today on the debian-devel-announce = mailing list >(and written with ReST, for a bonus): > >Debtags reaching the Packages file >http://lists.debian.org/debian-devel-announce/2005/07/msg00016.html > >Look for the article linked at the end, it's eye opening. :-) > >BTW, I met this guy (Enrico Zini) once recently, he's pleasant and = funny. >These days, wherever I turn, I see tags. :-) > >--=20 >Nicola Larosa - ni...@te... > > Perl: you shoot yourself in the foot, but can't figure out how you = did >it so you find a dozen new ways to do it. > Python: you shoot yourself in the foot and everything goes so = smoothly >that you go ahead to shoot yourself in the other foot then your = legs, >then your torso and then your head. Problem solved. > -- http://linux.sgms-centre.com/howto/shootfoot.php , October 2003 > > > > >------------------------------------------------------- > > > [Message truncated. Tap Edit->Mark for Download to get remaining = portion.] |
From: Nicola L. <ni...@te...> - 2005-07-23 22:29:14
|
Can't believe what appeared today on the debian-devel-announce mailing list (and written with ReST, for a bonus): Debtags reaching the Packages file http://lists.debian.org/debian-devel-announce/2005/07/msg00016.html Look for the article linked at the end, it's eye opening. :-) BTW, I met this guy (Enrico Zini) once recently, he's pleasant and funny. These days, wherever I turn, I see tags. :-) -- Nicola Larosa - ni...@te... Perl: you shoot yourself in the foot, but can't figure out how you did it so you find a dozen new ways to do it. Python: you shoot yourself in the foot and everything goes so smoothly that you go ahead to shoot yourself in the other foot then your legs, then your torso and then your head. Problem solved. -- http://linux.sgms-centre.com/howto/shootfoot.php , October 2003 |
From: Michael F. <mi...@pc...> - 2005-07-22 13:07:45
|
I've looked at the example of page tagging at http://typepad.thingamy.com There are now too many tags and not enough pages in his example for it to be useful - but I think I can see it. How about an app. with a set of tags down the sidebar. You click on them incrementally and it gradually whittles down the number of pages that match all the tags. You could do it using XMLHttpRequestObject (from javascript) to avoid reloading the entire page for each new tag - but because each new 'click' (new tag you select) is effectively a new search - you could serve it from a CGI. Using rest2web - you just define a set of tags for each page. As it is going rest2web can build an XML file (or files) storing URLs and tags. A single CGI can then be combined with a bit of javascript to allow browsing by tag. I'm going to implement 'tags' as a keyword immediately - because it will help me with SEO. Nicola - does what I'm discussing achieve what you want ? The only thing it won't allow is dynamic tagging of pages. Allowing users to apply their own tags to your pages is one idea... (or integrate with del.icio.us or something). With rest2web it's all static - done when you build the content. Regards, Fuzzy http://www.voidspace.org.uk/python |
From: Nicola L. <ni...@te...> - 2005-07-22 10:39:20
|
> Hmmm... There wouldn't *need* to be many structural changes if you can > resist tinkering with the parts that don't need changing ! That's great news. Yes, I think I maybe could exercise some degree of restraint, sometimes. ;-) > Will you *preserve* the indentation used in the config file ? No, I won't. :-) Think about it: do you get to decide what kind of indentation Python uses? You don't. Since indentation is not even significant here, why should we go to great lengths to parse and retain it? We'll give the user the option to have the file indented when written, and maybe *even* give the choice between one tab and four spaces, but that's it. The written layout will always be the same, consistent one (if any). > I've done a bit of browsing on the subject of nested hierarchies. > There's not a lot of consensus on the subject - and some of the > suggested alternatives are 'orrible. > > Hmmm... your suggestion is less bad than other possibilities I suppose, > less extra markup than XML. Glad to hear that. :-) > Ok if you must I suppose is the answer. Ehi, take the enthusiasm down a few notches! ;-P > Converting sys admins to normal sanity is a better option though... Who's being religious now? :-) Do you want to convert the very few, or build a tool that will be used by many? Remember, we're not talking about a way of life, like the choice of a programming language would be. It's just a config file format, for some deity's sake. We're even giving those fundamentalist Python programmers (you know who you are ;-D ) a way to partially force indentantion on their users (write-only), what more do you want? And *I* am the one go often gets to be called "fundamentalist" (not only by you, mind you), sheesh. ;-) > Markup by indentation is *good*. Then go and hack on PyYaml, what are you doing here? ;-P Seriously, I personally agree with you, I like it too. But in this case it's just something more to care for, something more one has to think about. Sysadmins actually *thinking*?!? The mind boggles... ;-D Now, to confirm your agreement once and for all, please stand up and say loudly, three times, the following: "I won't touch configobj.py anymore, until Nicola is finished or world's end, whichever comes first." Then sign on the dotted line below with your own blood, thank you very much. -- Nicola Larosa - ni...@te... When I was growing up, my parents used to say to me, "Tom, finish your dinner - people in China are starving." But after sailing to the edges of the flat world for a year, I am now telling my own daughters, "Girls, finish your homework - people in China and India are starving for your jobs." -- Thomas L. Friedman, New York Times, April 2005 |
From: Michael F. <mi...@pc...> - 2005-07-22 10:13:04
|
Nicola Larosa wrote: > This will probaby seem completely nuts to you, but please bear with me, > I'll try to be concise, *and* offer you a way out of Config Obj *now*. :-D > > > >>I think it makes the config files look more confusing. We use >>indentation for nesting sections. *so*, you either use what I have done >>so far, or you have to indent values *inside* a section. >> >>Mine (a section indented uniformly) : >> >>key = value >>key2 = value2 >> [section] >> key = value >> key2 = value2 >> [sub-section] >> key = value >> key2 = value2 >> >> [section2] >> key = value >> key2 = value2 >> >>Yours (values indented differently from their markers) : >> >>key = value >>[section] >> key = value # if you don't indent here >> key2 = value2 # there's no way to distinguish >> [sub-section] # this sub-section from section2 >> key = value >> key2 = value2 >> >>[section2] >> key = value >> key2 = value2 >> >>In your spec values have to be indented more than their section marker >>which is equally confusing. Added to which implementing your spec is >>*substantially* harder (for no gain IMHO). > > > I beg your pardon in advance. I know you spent much time implementing your > style, and then even changed it according to what I asked you (not the > above). But what I'm proposing could substantially improve ConfigObj > adoption chances, and simplify the code to boot. > > Thing is, I thought about it, and the only comment I could come up with, > about what I replied to this mail of yours, is: "What was I thinking?!?" > What I asked you, and you already implemented (not shown above) is > inconsistent and arbitrary. What you instead understood, and wrote above, > of what I asked, is how things are usually written in an XML file, and in > ZConfig pseudo-XML config format too. It *is* probably the best way... > > > ...but maybe all of this is moot. I keep believing that using indentation > in config files is a mistake, and I'm going to suggest a way to avoid it. > > > Remember, config files have to go into the hands of not-completely-human > beings called "sysadmins". ;-) You can be sure that most of them are > *horrified* by the prospect of significant indentation (that's true even of > most programmers that have not yet Seen the Light ;-) ). I really think we > should leave them free to indent their config files, or not, as they well > damn please. I believe that this would be a significant, and unnecessary, > barrier to the future adoption of ConfigObj. > > Let's now suppose instead that indentation is not significant: we still > have the problem to signal that a subsection is nested inside the previous > one. The XML, and ZConfig, way is to have a section closing marker: it > is ugly, unnecessary, and incompatible with straight INI files. > > A better way, I think, is to have an absolute level indicator in the > section marker itself. The marker should be absent at the outer level, to > keep compatibility with INI files, and should appear at inner levels. It > could be a digit, or a number of asterisks, but maybe the simplest and most > obvious thing is to multiply the square brackets, their number showing the > absolut nesting level: > > key = value > > [level 1] > key = value > > [[level 2]] > key = value > > [[level 2]] > key = value > > [[[level 3]]] > key = value > > [level 1] > key = value > > Obviously it would be illegal to have a level 3 subsection directly nested > inside a level one section. > > We could have an indented-write flag, so that the user could choose to > write out the config file in an indented shape: > > key = value > > [level 1] > key = value > > [[level 2]] > key = value > > [[level 2]] > key = value > > [[[level 3]]] > key = value > > [level 1] > key = value > > That would be for humans eyes only, the program would recognize any shape, > since indentantion is not significant anymore. > > > Again, I understand this means many changes to the code; I hope that it > would also allow one to throw away a good portion of it, and that's akways > a good thing. :-) > > I'll make you a deal: if you agree about the above, but are horrified by > the work needed to implement it, I propose that you *stop* working on > ConfigObj right now, and let *me* implement the needed changes, under your > direct control and supervision of each issue as it comes up, obviously. In > the meantime, you could go back to work on rets2web, or whatever is waiting > for your attention. > > Once I complete the rewriting, you would step back in, add the still > missing features, wrap it all up and release it into the world. :-) > > I know it takes a good deal of trusting, but I would ask you for any > structural change I'd make, and you have control of the repository anyway, > so what have you got to lose? :-) > > Hmmm... There wouldn't *need* to be many structural changes if you can resist tinkering with the parts that don't need changing ! Will you *preserve* the indentation used in the config file ? I've done a bit of browsing on the subject of nested hierarchies. There's not a lot of consensus on the subject - and some of the suggested alternatives are 'orrible. Hmmm... your suggestion is less bad than other possibilities I suppose, less extra markup than XML. Ok if you must I suppose is the answer. Converting sys admins to normal sanity is a better option though.... Markup by indentation is *good*. Regards, Fuzz http://www.voidspace.org.uk/python |
From: Michael F. <mi...@pc...> - 2005-07-22 08:38:48
|
Nicola Larosa wrote: [snip..] > > Scalar values and (sub)sections at the same level MUST have the same > indent, it's too confusing otherwise. > > There are only two ways to get this, that I can see: > > 1) introduce a end-of-section header, like ZConfig does; now we're not > INI file format compatible anymore. Not good. > > 2) *only* allow scalar values *before* subsections in each section. Then > the end of the section is marked by the beginning of the next > (sub)section, or the end of the file. > > I think that 2) is an acceptable limitation to live with. After all, > grouping scalar values before *or* between *or* after sections, without > explicitly putting them into real sections, introduces a kind of implicit > sections that I don't like at all. Does that grouping have any meaning? Who > knows? > > I find 2) much preferable than having different indents for scalar values > and (sub)sections at the same level. Whatever you do, please don't do this. > I'm serious. > Sorry to harp on about this - but I'm not *convinced* that the implementation is yet right. I *hope* it is. The current rule is basically : A new section must be indented relative to it's parent section. Sections in the root section aren't indented (since they don't have a parent). Scalar values must come before sub-sections. This means config files look like : key = value key2 = value2 [ section ] key = value key2 = value2 [sub-section] key = value key2 = value2 [ section 2 ] key = value key2 = value2 [sub-section] key = value key2 = value2 *But* - in 'section', 'sub-section' is as the same level as 'key' and 'key2'. Is that ok ? Best Regards, Fuzzy http://www.voidspace.org.uk/python |
From: Nicola L. <ni...@te...> - 2005-07-22 08:29:56
|
This will probaby seem completely nuts to you, but please bear with me, I'll try to be concise, *and* offer you a way out of Config Obj *now*. :-D > I think it makes the config files look more confusing. We use > indentation for nesting sections. *so*, you either use what I have done > so far, or you have to indent values *inside* a section. > > Mine (a section indented uniformly) : > > key = value > key2 = value2 > [section] > key = value > key2 = value2 > [sub-section] > key = value > key2 = value2 > > [section2] > key = value > key2 = value2 > > Yours (values indented differently from their markers) : > > key = value > [section] > key = value # if you don't indent here > key2 = value2 # there's no way to distinguish > [sub-section] # this sub-section from section2 > key = value > key2 = value2 > > [section2] > key = value > key2 = value2 > > In your spec values have to be indented more than their section marker > which is equally confusing. Added to which implementing your spec is > *substantially* harder (for no gain IMHO). I beg your pardon in advance. I know you spent much time implementing your style, and then even changed it according to what I asked you (not the above). But what I'm proposing could substantially improve ConfigObj adoption chances, and simplify the code to boot. Thing is, I thought about it, and the only comment I could come up with, about what I replied to this mail of yours, is: "What was I thinking?!?" What I asked you, and you already implemented (not shown above) is inconsistent and arbitrary. What you instead understood, and wrote above, of what I asked, is how things are usually written in an XML file, and in ZConfig pseudo-XML config format too. It *is* probably the best way... ...but maybe all of this is moot. I keep believing that using indentation in config files is a mistake, and I'm going to suggest a way to avoid it. Remember, config files have to go into the hands of not-completely-human beings called "sysadmins". ;-) You can be sure that most of them are *horrified* by the prospect of significant indentation (that's true even of most programmers that have not yet Seen the Light ;-) ). I really think we should leave them free to indent their config files, or not, as they well damn please. I believe that this would be a significant, and unnecessary, barrier to the future adoption of ConfigObj. Let's now suppose instead that indentation is not significant: we still have the problem to signal that a subsection is nested inside the previous one. The XML, and ZConfig, way is to have a section closing marker: it is ugly, unnecessary, and incompatible with straight INI files. A better way, I think, is to have an absolute level indicator in the section marker itself. The marker should be absent at the outer level, to keep compatibility with INI files, and should appear at inner levels. It could be a digit, or a number of asterisks, but maybe the simplest and most obvious thing is to multiply the square brackets, their number showing the absolut nesting level: key = value [level 1] key = value [[level 2]] key = value [[level 2]] key = value [[[level 3]]] key = value [level 1] key = value Obviously it would be illegal to have a level 3 subsection directly nested inside a level one section. We could have an indented-write flag, so that the user could choose to write out the config file in an indented shape: key = value [level 1] key = value [[level 2]] key = value [[level 2]] key = value [[[level 3]]] key = value [level 1] key = value That would be for humans eyes only, the program would recognize any shape, since indentantion is not significant anymore. Again, I understand this means many changes to the code; I hope that it would also allow one to throw away a good portion of it, and that's akways a good thing. :-) I'll make you a deal: if you agree about the above, but are horrified by the work needed to implement it, I propose that you *stop* working on ConfigObj right now, and let *me* implement the needed changes, under your direct control and supervision of each issue as it comes up, obviously. In the meantime, you could go back to work on rets2web, or whatever is waiting for your attention. Once I complete the rewriting, you would step back in, add the still missing features, wrap it all up and release it into the world. :-) I know it takes a good deal of trusting, but I would ask you for any structural change I'd make, and you have control of the repository anyway, so what have you got to lose? :-) -- Nicola Larosa - ni...@te... When I was growing up, my parents used to say to me, "Tom, finish your dinner - people in China are starving." But after sailing to the edges of the flat world for a year, I am now telling my own daughters, "Girls, finish your homework - people in China and India are starving for your jobs." -- Thomas L. Friedman, New York Times, April 2005 |
From: Michael F. <mi...@pc...> - 2005-07-22 08:05:15
|
Nicola Larosa wrote: >>Well - thats enough hacking for 1 night. >> >>2005/07/21 >>Changed Section.sequence to Section.scalars and Section.sections >>Added Section.configspec >>Sections in the root section now have no extra indentation >>Comments now better supported in Section and preserved by ConfigObj >>Comments also written out >>Implemented initial_comment and final_comment >>A scalar value after a section will now raise an error > > > Well done. > The nice thing is that everywhere that used ``Section.sequence`` could just use ``(Section.scalars + Section.sections)``. It was only used *inside* Section methods - so I just had to go through carefully changing them. I've now *fully* implemented comment support as well - although it's possible there are bugfixes still to do (of course). Seems to work though. > I *knew* I had better put my little fingers at rest. I hope you didn't try > to commit your changes, I undid mine just now, go ahead and commit yours, I > have the patch with my changes and will reapply the relevant ones sooner or > later. > No - I'd just checked out your version, and was downloading the win32 binaries for pygtk so I could get meld working. I prefer your idea though ;-) I'll commit my changes now. > Ah, the beauty of Version Control. :-) > Except I was *sure* I'd already made the changes to ``validate`` - so that it did the try..except business and changed values. Still - they're simple changes. The changes last night are the first *structural* changes to the core parser since I first implemented it. (Only very slight changes - much less than I expected). I'd like to get ConfigObj banged out of the way. There's lots I'd still like to do to my website, which means more work on rest2web. Getting ConfigObj finished/documented/packaged may still take a couple of weeks - but I don't want it to take any longer (if possible - better to get it right of course). All the best. Fuzzy http://www.voidspace.org.uk/python |
From: Nicola L. <ni...@te...> - 2005-07-22 07:42:02
|
> Well - thats enough hacking for 1 night. > > 2005/07/21 > Changed Section.sequence to Section.scalars and Section.sections > Added Section.configspec > Sections in the root section now have no extra indentation > Comments now better supported in Section and preserved by ConfigObj > Comments also written out > Implemented initial_comment and final_comment > A scalar value after a section will now raise an error Well done. I *knew* I had better put my little fingers at rest. I hope you didn't try to commit your changes, I undid mine just now, go ahead and commit yours, I have the patch with my changes and will reapply the relevant ones sooner or later. Ah, the beauty of Version Control. :-) -- Nicola Larosa - ni...@te... When I was growing up, my parents used to say to me, "Tom, finish your dinner - people in China are starving." But after sailing to the edges of the flat world for a year, I am now telling my own daughters, "Girls, finish your homework - people in China and India are starving for your jobs." -- Thomas L. Friedman, New York Times, April 2005 |
From: Michael F. <mi...@pc...> - 2005-07-21 22:55:21
|
Well - thats enough hacking for 1 night. 2005/07/21 Changed Section.sequence to Section.scalars and Section.sections Added Section.configspec Sections in the root section now have no extra indentation Comments now better supported in Section and preserved by ConfigObj Comments also written out Implemented initial_comment and final_comment A scalar value after a section will now raise an error |
From: Nicola L. <ni...@te...> - 2005-07-21 22:33:10
|
Sorry, I did some work on configobj.py , couldn't help it. 0:-} Mostly more code cleanup (a couple requests later, quibbles really), changed "test" to "check" for validation, but the tests still fail. The "validate" method needs to wrap each check in a try...except now, and also needs to change the stored values with those returned by the check, if it succeed. I thought it better leaving these changes to you, for now. :-) -- Nicola Larosa - ni...@te... When I was growing up, my parents used to say to me, "Tom, finish your dinner - people in China are starving." But after sailing to the edges of the flat world for a year, I am now telling my own daughters, "Girls, finish your homework - people in China and India are starving for your jobs." -- Thomas L. Friedman, New York Times, April 2005 |
From: Michael F. <mi...@pc...> - 2005-07-21 20:50:15
|
I've been thinking about rest2web and tags. I'd like to implement something very quickly to use in the keywords meta = tag of each page. A friend of mine has shown me the power of SEO = recently - his small website http://www.fuchsiashockz.co.uk actually = comes *first* in google for lots of searches now ('cyberpunk articles', = 'strange articles' etc). Building an XML file of tags/pages to be browsed dynamically by a CGI = would be *reasonably* easy.=20 I'll have to try and understand this rel=3D"tag" business for = hyperlinks....=20 I *also* need to implement a plugin gallery for rest2web. The gallery = pages currently on my site are badly in need of updates.... I think I'd like to get ConfigObj feature complete first... Fuzzy -----Original Message----- >From: "Nicola Larosa"<ni...@te...> >Sent: 21/07/05 17:43:52 >To: "Michael Foord"<mi...@pc...> >Subject: Doc Searls about tags > >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Remember that idea of mine about tags-driven navigation for a web = site? Doc >Searls talks about tags on his SuitWatch newsletter (always = interesting, BTW): > >SuitWatch - July 21 >http://lists.ssc.com/pipermail/suitwatch/2005-July/000090.html > >I'll give a good look at this Thingamy thingie. :-) > >- -- >Nicola Larosa - ni...@te... > >When I was growing up, my parents used to say to me, "Tom, finish = your >dinner - people in China are starving." But after sailing to the = edges >of the flat world for a year, I am now telling my own daughters, = "Girls, >finish your homework - people in China and India are starving for = your >jobs." -- Thomas L. Friedman, New York Times, April 2005 > > >-----BEGIN PGP SIGNATURE----- >Version: GnuPG v1.4.1 (GNU/Linux) >Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org > > > [Message truncated. Tap Edit->Mark for Download to get remaining = portion.] |
From: Michael F. <mi...@pc...> - 2005-07-21 18:38:33
|
*Phew* That was a lot easier than I imagined.=20 In fact I was wrong - ConfigObj *didn't* alter the structure of files it = wrote back out. (Which meant it could generate files with values in the = wrong place). It now sticks to your proposed structure when generating new ConfigObjs = as well. I've also changed Section to use separate scalars and sections = attributes. It only took 15 minutes and all tests still pass - was very = surprised. :-D The only thing is it will still parse (now) invalid config files without = raising an error : key =3D val key2 =3D val2 [ sect ] key =3D val key2 =3D val2 [sub-sect] key =3D val key2 =3D val2 [sub-sub-sect] key =3D val [sub-sect2] key =3D val key2 =3D val2 key3 =3D val In the above file ``key3`` should raise an error. Currently it is put in = sect. All the best.... Fuzzy Http://www.voidspace.org.uk/python |