rest2web-develop Mailing List for rest2web (Page 14)
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: Debian P. T. S. <pt...@qa...> - 2006-08-07 21:30:32
|
Hello, you asked to be subscribed to the "mailing list"[1] for the Debian source package called rest2web. To complete this process, you have to reply to this mail by including this command : CONFIRM fd85c7d454b3df9f9d1696ce8d4aca03 On any modern mailer, you just have to hit reply and send the mail. If you don't understand why you got this mail, please ignore it, you won't be subscribed to anything unless you confirm it. If you have any problem with this service, please contact ow...@pa.... Thanks, [1] This list receives all the bug reports (and the corresponding logs) for the package "rest2web" that are sent to the Debian Bug Tracking System. http://packages.qa.debian.org/rest2web |
From: martin f k. <ma...@ma...> - 2006-08-07 21:23:52
|
also sprach martin f krafft <ma...@ma...> [2006.08.04.1029 +0100]: > > If this happens there will be a bug tracker at : > >=20 > > http://bugs.debian.org/rest2web > >=20 > > Which does not yet exist, but : > >=20 > > http://bugs.debian.org/rest2web;pend-exc=3Ddone;include=3Dupstream;excl= ude=3Dwontfix >=20 > Clarification: I will upload the Debian package RSN now, then the > above links will work. The second one is intended for Michael as it > lists only those bugs I/we mark as upstream-relevant, and which have > not been closed or marked wontfix. >=20 > http://bugs.debian.org has the details. The page is now in place. There will also be http://packages.qa.debian.org/r/rest2web.html sometime soon to allow people to keep track. I am also going to subscribe this mailing list to receive all bug reports, so expect a confirmation mail. :) Oh, and 0.5.0~beta~svn-r201-1 should be in unstable now. Cheers, --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "women love us for our defects. if we have enough of them, they will forgive us everything, even our gigantic intellects." -- oscar wilde |
From: martin f k. <ma...@ma...> - 2006-08-07 15:27:22
|
also sprach Michael Foord <fuz...@vo...> [2006.08.06.1852 +010= 0]: > I found the problem. The uservalues were going in as unicode. I have=20 > sorted that, and added an extra safeguard against similar problems. I can confirm that the problem does not exist in current SVN anymore. --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 a c programmer asked whether computers have buddha's nature. as the answer, the master did "rm -rf" on the programmer's home directory. and then the c programmer became enlightened... |
From: Gael V. <gae...@no...> - 2006-08-06 22:21:27
|
On Sun, Aug 06, 2006 at 03:54:19PM +0100, Michael Foord wrote: > The code that executes templates uses a single namespace. If you modify= =20 > that namespace (create variables etc) then they should persist for that= =20 > whole page - in the order that they are created in the page. Good, useful. > By the way Gael: You may find the journal/blog style parts of your site= =20 > easier to administer with `Firedrop2=20 > <http://www.voidspace.org.uk/python/firedrop2/>`_. You can still make=20 > entries with ReST - but it handles archives/RSS/categories etc for you,= =20 > and lets you administer each entry separately. Just a thought. :-) Yeah, maybe, one day... You know, I don't like GUIs. Thats clearly one thing I like about rest2web: it is fully based on what is on the disk, which allow to make it work on directories synchronised between different boxes in different places. The danger of course is coding to many things myself and reinventing the wheel. This is why I should try investing more time in testing/giving feedback to rest2web. But xurrently not only am I overloaded by my day job, but I also have a sore wrist from spending to much time in front of a computer ;->. Anyway, I think you a doing a great job with rest2web and I really look forwards to the release in which the compiling of the web site will be done in two passes (this does seems like the Right Thing). Cheers, --=20 Ga=EBl |
From: Michael F. <fuz...@vo...> - 2006-08-06 21:58:59
|
martin f krafft wrote: > If I run r2w with -w, I still get to see > > ---8<--- > rest2web version 0.5.0 beta1 > Running rest2web the Site Builder. > Sun Aug 6 22:05:28 2006 > > > Time taken to build site was 1.482 seconds. > 5 files processed. > ---8<--- > > The --help output says: > > -w Display warnings only. > > Somehow I think there's an inconsistency. :) > > Ok - I'll move the level of those messages to INFO. > Cheers, > > PS: Here's a good example docbook manpage: > Youch... :-p Oh well, time to find a good tutorial somewhere. I'll write a manpage for r2w.py - but it will be a simple description and an overview of the command line options. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > http://madduck.net/~madduck/scratch/__tmp__iptables-apply.dbk > 4497 4c5e8829ba6c644d363dce0e51f25d3e > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: martin f k. <ma...@ma...> - 2006-08-06 21:10:15
|
If I run r2w with -w, I still get to see ---8<--- rest2web version 0.5.0 beta1 Running rest2web the Site Builder. Sun Aug 6 22:05:28 2006 Time taken to build site was 1.482 seconds. 5 files processed. ---8<--- The --help output says: -w Display warnings only. Somehow I think there's an inconsistency. :) Cheers, PS: Here's a good example docbook manpage: http://madduck.net/~madduck/scratch/__tmp__iptables-apply.dbk 4497 4c5e8829ba6c644d363dce0e51f25d3e --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "there are lots of reasons not to use linux. there just aren't any good ones." --steven j. vaughan-nichols |
From: Michael F. <fuz...@vo...> - 2006-08-06 19:56:56
|
Hello all, rest2web 0.5.0 beta 1 has just been released. See the following announcement for all the details and the download links : http://www.voidspace.org.uk/python/weblog/arch_d7_2006_08_05.shtml#e413 I would appreciate it if you could download it and kick the tyres. :-) All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml |
From: Michael F. <fuz...@vo...> - 2006-08-06 16:51:18
|
Michael Foord wrote: > martin f krafft wrote: > >> Michael, >> >> I see restutils.encode uses the string encode function. I don't >> think this is what you want. >> >> < madduck> so i am baffled >> < madduck> >>> type('bla'.encode('utf-8')) >> < madduck> <type 'str'> >> < cracki> encode returns 8 bit >> < madduck> or even worse, >> < madduck> >>> type(u'bla'.encode('utf-8')) >> < madduck> <type 'str'> >> < cracki> you want unicode("bla") >> < cracki> encode encodes to binary representations >> < madduck> what's the point of "encode('utf-8')" then? >> < cracki> unicode("foo", "utf-8") >> < cracki> encode(u"someunicodestr", "weirdencoding") transforms to a >> binary representation >> < cracki> in memory, unicode strings are multibyte, constant width >> >> Please also see >> http://docs.python.org/tut/node5.html#SECTION005130000000000000000 >> http://www.reportlab.com/i18n/python_unicode_tutorial.html >> >> >> > Another good tutorial on Unicode : > > http://www.pyzine.com/Issue008/Section_Articles/article_Encodings.html > > :-) > > >> The reason I am posting this is because I am getting an error >> >> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in >> position 2555: ordinal not in range(128) >> >> This is due to a file that says "Zürich", and the file itself is >> UTF-8, as is the template: >> >> lapse:~/phd/web> head -15 imprint.txt [390] >> restindex >> encoding: utf8 >> template-encoding: >> /restindex >> [...] >> 8050 Zürich >> >> The exception is thrown in line 75 of embedded_code.py: >> >> template = template.replace(occ, value) >> >> when template holds the template text just after body had been >> filled in with the result from the imprint.txt transformed to HTML. >> Template is a str, not a unicode object, which is the root of all >> evil. >> >> Am I doing something wrong? >> >> > I think it is the other way round, by the time they are rendered they > should all be byte-strings rather than unicode. > > Anyway, I'm going round in circles trying to chase this one down. > > Can you try it with an explicit 'output-encoding' of 'utf-8' and see if > you have the same problem. > Even worse - when I make a test case, it works ! I have two files (index.txt and imprint.txt). imprint.txt just has your 'Zürich' in it - but they both have the same restindexes... I took great pains to make sure it was *genuinely* encoded with utf-8 (for example, in the email you sent it was 'latin-1', but this is probably irrelevant). This means the problem is something to do with the template - possibly the uservalues are still in unicode or something. (If you try to mix unicode and byte-strings then Python will try to decode all the byte-strings to unicode using the ascii codec, this would cause the exception you saw.) I'm going to see if I can isolate the bug with the template... By the way - I see your problem with uservalues. In r2w.ini, you need to put them into a uservalues section : [uservalues] site_title = Method diffusion in large open source projects site_subtitle = Ph.D. research by Martin F. Krafft Michael > Thanks > > Michael > http://www.voidspace.org.uk/python/index.shtml > > >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share your >> opinions on IT & business topics through brief surveys -- and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rest2web-develop mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/rest2web-develop >> >> > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |
From: Michael F. <fuz...@vo...> - 2006-08-06 16:50:19
|
Michael Foord wrote: > martin f krafft wrote: > >> Michael, >> >> I see restutils.encode uses the string encode function. I don't >> think this is what you want. >> >> < madduck> so i am baffled >> < madduck> >>> type('bla'.encode('utf-8')) >> < madduck> <type 'str'> >> < cracki> encode returns 8 bit >> < madduck> or even worse, >> < madduck> >>> type(u'bla'.encode('utf-8')) >> < madduck> <type 'str'> >> < cracki> you want unicode("bla") >> < cracki> encode encodes to binary representations >> < madduck> what's the point of "encode('utf-8')" then? >> < cracki> unicode("foo", "utf-8") >> < cracki> encode(u"someunicodestr", "weirdencoding") transforms to a >> binary representation >> < cracki> in memory, unicode strings are multibyte, constant width >> >> Please also see >> http://docs.python.org/tut/node5.html#SECTION005130000000000000000 >> http://www.reportlab.com/i18n/python_unicode_tutorial.html >> >> >> > Another good tutorial on Unicode : > > http://www.pyzine.com/Issue008/Section_Articles/article_Encodings.html > > :-) > > >> The reason I am posting this is because I am getting an error >> >> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in >> position 2555: ordinal not in range(128) >> >> This is due to a file that says "Zürich", and the file itself is >> UTF-8, as is the template: >> >> lapse:~/phd/web> head -15 imprint.txt [390] >> restindex >> encoding: utf8 >> template-encoding: >> /restindex >> [...] >> 8050 Zürich >> >> The exception is thrown in line 75 of embedded_code.py: >> >> template = template.replace(occ, value) >> >> when template holds the template text just after body had been >> filled in with the result from the imprint.txt transformed to HTML. >> Template is a str, not a unicode object, which is the root of all >> evil. >> >> Am I doing something wrong? >> >> > I think it is the other way round, by the time they are rendered they > should all be byte-strings rather than unicode. > > Anyway, I'm going round in circles trying to chase this one down. > > Can you try it with an explicit 'output-encoding' of 'utf-8' and see if > you have the same problem. > Even worse - when I make a test case, it works ! I have two files (index.txt and imprint.txt). imprint.txt just has your 'Zürich' in it - but they both have the same restindexes... I took great pains to make sure it was *genuinely* encoded with utf-8 (for example, in the email you sent it was 'latin-1', but this is probably irrelevant). This means the problem is something to do with the template - possibly the uservalues are still in unicode or something. (If you try to mix unicode and byte-strings then Python will try to decode all the byte-strings to unicode using the ascii codec, this would cause the exception you saw.) I'm going to see if I can isolate the bug with the template... Michael > Thanks > > Michael > http://www.voidspace.org.uk/python/index.shtml > > >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share your >> opinions on IT & business topics through brief surveys -- and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rest2web-develop mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/rest2web-develop >> >> > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |
From: Michael F. <fuz...@vo...> - 2006-08-06 16:24:40
|
martin f krafft wrote: > Michael, > > I see restutils.encode uses the string encode function. I don't > think this is what you want. > > < madduck> so i am baffled > < madduck> >>> type('bla'.encode('utf-8')) > < madduck> <type 'str'> > < cracki> encode returns 8 bit > < madduck> or even worse, > < madduck> >>> type(u'bla'.encode('utf-8')) > < madduck> <type 'str'> > < cracki> you want unicode("bla") > < cracki> encode encodes to binary representations > < madduck> what's the point of "encode('utf-8')" then? > < cracki> unicode("foo", "utf-8") > < cracki> encode(u"someunicodestr", "weirdencoding") transforms to a > binary representation > < cracki> in memory, unicode strings are multibyte, constant width > > Please also see > http://docs.python.org/tut/node5.html#SECTION005130000000000000000 > http://www.reportlab.com/i18n/python_unicode_tutorial.html > > Another good tutorial on Unicode : http://www.pyzine.com/Issue008/Section_Articles/article_Encodings.html :-) > The reason I am posting this is because I am getting an error > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in > position 2555: ordinal not in range(128) > > This is due to a file that says "Zürich", and the file itself is > UTF-8, as is the template: > > lapse:~/phd/web> head -15 imprint.txt [390] > restindex > encoding: utf8 > template-encoding: > /restindex > [...] > 8050 Zürich > > The exception is thrown in line 75 of embedded_code.py: > > template = template.replace(occ, value) > > when template holds the template text just after body had been > filled in with the result from the imprint.txt transformed to HTML. > Template is a str, not a unicode object, which is the root of all > evil. > > Am I doing something wrong? > I think it is the other way round, by the time they are rendered they should all be byte-strings rather than unicode. Anyway, I'm going round in circles trying to chase this one down. Can you try it with an explicit 'output-encoding' of 'utf-8' and see if you have the same problem. Thanks Michael http://www.voidspace.org.uk/python/index.shtml > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: Michael F. <fuz...@vo...> - 2006-08-06 15:20:12
|
martin f krafft wrote: > also sprach Michael Foord <mi...@pc...> [2006.08.03.2322 +0100]: > >> make_dist.py now takes a 'nopause' option as a command line argument. >> > > Can r2w also get an option like this, to override the r2w.ini > setting? The following patch implements -n/--nopause > This patch is applied, but not yet committed. I will fix the unicode bug first. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Index: rest2web/command_line.py > =================================================================== > --- rest2web/command_line.py (revision 194) > +++ rest2web/command_line.py (working copy) > @@ -49,6 +49,7 @@ > 'template': None, > 'uservalues': [], > 'force': False, > + 'nopause': False, > } > > usage = "%prog [options] config_file" > @@ -88,6 +89,10 @@ > parser.add_option("-f", '--force', action="store_true", dest="force", > help="Force site without indexes, restindexes or template.") > # > + # No pause > + parser.add_option("-n", '--nopause', action="store_true", dest="nopause", > + help="Do not pause after processing (overrides setting in config file).") > + # > parser.set_defaults(**DEFAULTS) > # > (option_obj, args) = parser.parse_args() > @@ -107,6 +112,7 @@ > # > options['uservalues'] = get_uservalues(option_obj.uservalues, enc) > options['force'] = option_obj.force > + options['nopause'] = option_obj.nopause > # > # Sort the arguments > if args: > Index: r2w.py > =================================================================== > --- r2w.py (revision 194) > +++ r2w.py (working copy) > @@ -134,6 +134,7 @@ > pass > # > options, config = get_config() > + print options > if os.path.isfile('__dist__'): > print 'Won\'t run from distribution directory.' > print "Run 'make_dist.py' and use the distribution it creates." > @@ -202,7 +203,8 @@ > if standerr: > standerr.close() > # > - if istrue(config.get('pause', 'False')): > + if not options.get('nopause', False) \ > + and istrue(config.get('pause', 'False')): > raw_input('Hit return to continue >>> ') > > """ > > > > > Thanks, > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: Michael F. <fuz...@vo...> - 2006-08-06 14:50:55
|
Gael Varoquaux wrote: >> These add to the namespace, *and* to pages in the indextree, various >> pieces of information about the pages : >> > > > >> 'source_file': The source file for the page >> > > >> 'current_dir': The current directory being processed - this can be >> turned into an absolute filepath by doing os.path.join(os.getcwd(), >> current_dir) >> > > >> 'target_dir': The target file directory (as an absolute file path) being >> rendered into. Note if the file has a target specified it may not be put >> in this directory. Use os.path.dirname(target_file) instead. >> > > >> 'full_page_url': The full url (starting with '/') for the current page >> > > >> 'target_file': The full filename of the page being rendered >> > > Now that _is_ useful ! > > Hello Gael, > Can I suggest another change : for each page, variables created in > one code block are kept and accessible for the next code blocks. You can > have a look at what I do in pyreport ( > http://gael-varoquaux.info/computers/pyreport ) to see how I do > something similar. Check out the function executeBlock: I save the > namespace at the end of the function call and reinject it later in my > "exec" call. > > The code that executes templates uses a single namespace. If you modify that namespace (create variables etc) then they should persist for that whole page - in the order that they are created in the page. *However*, up until about five minutes ago eval was done before exec. That meant that you couldn't do : <# xyz = 3 #> <% xyz %> (<% .. %> was always done first.) I've just reversed the order - so that should work now. > This would be really useful and would allow to avoid to much code > duplication in "template.txt" and in the different files processed. > > By the way Gael: You may find the journal/blog style parts of your site easier to administer with `Firedrop2 <http://www.voidspace.org.uk/python/firedrop2/>`_. You can still make entries with ReST - but it handles archives/RSS/categories etc for you, and lets you administer each entry separately. Just a thought. :-) Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Cheers, > > Gaël > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |
From: Gael V. <gae...@no...> - 2006-08-06 13:39:17
|
> These add to the namespace, *and* to pages in the indextree, various=20 > pieces of information about the pages : > 'source_file': The source file for the page > 'current_dir': The current directory being processed - this can be=20 > turned into an absolute filepath by doing os.path.join(os.getcwd(),=20 > current_dir) > 'target_dir': The target file directory (as an absolute file path) bein= g=20 > rendered into. Note if the file has a target specified it may not be pu= t=20 > in this directory. Use os.path.dirname(target_file) instead. > 'full_page_url': The full url (starting with '/') for the current page > 'target_file': The full filename of the page being rendered Now that _is_ useful ! Can I suggest another change : for each page, variables created in one code block are kept and accessible for the next code blocks. You can have a look at what I do in pyreport ( http://gael-varoquaux.info/computers/pyreport ) to see how I do something similar. Check out the function executeBlock: I save the namespace at the end of the function call and reinject it later in my "exec" call. This would be really useful and would allow to avoid to much code duplication in "template.txt" and in the different files processed. Cheers, Ga=EBl |
From: Michael F. <fuz...@vo...> - 2006-08-06 13:02:52
|
martin f krafft wrote: > also sprach Michael Foord <fuz...@vo...> [2006.08.05.1609 +0100]: > >>>> The better way of achieving this is to provide uservalues in your site >>>> config file. These are already available to every page. >>>> >>> by site config file, you mean .ini file? >>> >>> >> Yes. >> > > How do I read them? I tried for a while and reread the entire docs. > Sorry, but I couldn't figure it out. > > You *should* be able to do the following : Put something like this in your config file : [uservalues] site_wide_title = 'A nice site title' Then in your templates/pages you should just be able to use the name ``site_wide_title`` directly, it should be in your namespace. Let me know if this doesn't work and I will fix it. Michael > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: Michael F. <fuz...@vo...> - 2006-08-06 12:54:00
|
martin f krafft wrote: > I am getting closer to my goal. Two remaining questions now are > > - how can I get the page object (indextree node) of the page > currently being rendered? Do I really have to do a recursive > search through the tree until thispage is true? > > - I saw the target value, which is the URL of any page relative to > the one currently being rendered. I wonder whether it is > possible to get the URL of the currently rendered page relative > to the root as well? So page_url:target:base_url triplets would > be (for foo/index.txt) > > /index.html:../index.html > /bar.html:../bar.html > /foo/index.html:index.html > /foo/bar.html:bar.html > I've just committed some changes to SVN. These add to the namespace, *and* to pages in the indextree, various pieces of information about the pages : 'source_file': The source file for the page 'current_dir': The current directory being processed - this can be turned into an absolute filepath by doing os.path.join(os.getcwd(), current_dir) 'target_dir': The target file directory (as an absolute file path) being rendered into. Note if the file has a target specified it may not be put in this directory. Use os.path.dirname(target_file) instead. 'full_page_url': The full url (starting with '/') for the current page 'target_file': The full filename of the page being rendered I've also nailed a tricky bug with the finding of 'thispage'. Now to nail the unicode bug, and possibly add an 'include_rest' function. Michael http://www.voidspace.org.uk/python/index.shtml > Thanks, > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: Peter TB B. <pe...@pe...> - 2006-08-06 06:49:40
|
On Sunday 06 August 2006 03:56, Holt, Patrick wrote: > Can I please be eliminated from your email list, thank you? > Look at the List-Unsubscribe header placed at the top of every list e-mail. Peter List-Id: "A list to discuss development of rest2web." <rest2web-develop.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/rest2web-de= velop>, <mailto:res...@li...?subject=3Dunsubscri= be> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=3Drest2we= b-develop> List-Post: <mailto:res...@li...> List-Help: <mailto:res...@li...?subject= =3Dhelp> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/rest2web-deve= lop>, <mailto:res...@li...?subject=3Dsubscribe> =2D-=20 =46isher Society publicity officer http://tinyurl.com/o39w2 CUSBC novices, match and league secretary http://tinyurl.com/mwrc9 Quake II build tools maintainer http://tinyurl.com/fkldd v2sw6YShw7$ln5pr6ck3ma8u6/8Lw3+2m0l7Ci6e4+8t4Eb8Aen5+6g6Pa2Xs5MSr5p4 hackerkey.com |
From: Holt, P. <ph...@mc...> - 2006-08-06 02:57:21
|
Can I please be eliminated from your email list, thank you? Patrick L. Holt=20 -----Original Message----- From: res...@li... [mailto:res...@li...] On Behalf Of martin f krafft Sent: Saturday, August 05, 2006 9:28 PM To: Michael Foord Cc: A list to discuss development of rest2web. Subject: Re: [Rest2web-develop] Recent Issues also sprach martin f krafft <ma...@ma...> [2006.08.06.0225 +0100]: > Index: r2w.py > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- r2w.py (revision 194) > +++ r2w.py (working copy) > @@ -134,6 +134,7 @@ > pass > # > options, config =3D get_config() > + print options > if os.path.isfile('__dist__'): > print 'Won\'t run from distribution directory.' > print "Run 'make_dist.py' and use the distribution it creates." mh, i hope you'll ignore this chunk. :) --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 perl -e 'print "The earth is a disk!\n" if ( "earth" =3D=3D "flat" );' |
From: martin f k. <ma...@ma...> - 2006-08-06 01:27:57
|
also sprach martin f krafft <ma...@ma...> [2006.08.06.0225 +0100]: > Index: r2w.py > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- r2w.py (revision 194) > +++ r2w.py (working copy) > @@ -134,6 +134,7 @@ > pass > # > options, config =3D get_config() > + print options > if os.path.isfile('__dist__'): > print 'Won\'t run from distribution directory.' > print "Run 'make_dist.py' and use the distribution it creates." mh, i hope you'll ignore this chunk. :) --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 perl -e 'print "The earth is a disk!\n" if ( "earth" =3D=3D "flat" );' |
From: martin f k. <ma...@ma...> - 2006-08-06 01:25:18
|
also sprach Michael Foord <mi...@pc...> [2006.08.03.2322 +0100]: > make_dist.py now takes a 'nopause' option as a command line argument. Can r2w also get an option like this, to override the r2w.ini setting? The following patch implements -n/--nopause Index: rest2web/command_line.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- rest2web/command_line.py (revision 194) +++ rest2web/command_line.py (working copy) @@ -49,6 +49,7 @@ 'template': None, 'uservalues': [], 'force': False, + 'nopause': False, } =20 usage =3D "%prog [options] config_file" @@ -88,6 +89,10 @@ parser.add_option("-f", '--force', action=3D"store_true", dest=3D"forc= e", help=3D"Force site without indexes, restindexes or template.") # + # No pause + parser.add_option("-n", '--nopause', action=3D"store_true", dest=3D"no= pause", + help=3D"Do not pause after processing (overrides setting in config= file).") + # parser.set_defaults(**DEFAULTS) # (option_obj, args) =3D parser.parse_args() @@ -107,6 +112,7 @@ # options['uservalues'] =3D get_uservalues(option_obj.uservalues, enc) options['force'] =3D option_obj.force + options['nopause'] =3D option_obj.nopause # # Sort the arguments if args: Index: r2w.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- r2w.py (revision 194) +++ r2w.py (working copy) @@ -134,6 +134,7 @@ pass # options, config =3D get_config() + print options if os.path.isfile('__dist__'): print 'Won\'t run from distribution directory.' print "Run 'make_dist.py' and use the distribution it creates." @@ -202,7 +203,8 @@ if standerr: standerr.close() # - if istrue(config.get('pause', 'False')): + if not options.get('nopause', False) \ + and istrue(config.get('pause', 'False')): raw_input('Hit return to continue >>> ') =20 """ Thanks, --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "violence is the last refuge of the incompetent" -- isaac asimov |
From: martin f k. <ma...@ma...> - 2006-08-06 00:20:19
|
also sprach Michael Foord <fuz...@vo...> [2006.08.05.1609 +010= 0]: > >>The better way of achieving this is to provide uservalues in your site= =20 > >>config file. These are already available to every page. > > > >by site config file, you mean .ini file? > > =20 > Yes. How do I read them? I tried for a while and reread the entire docs. Sorry, but I couldn't figure it out. --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "i hate vulgar realism in literature. the man who could call a spade a spade should be compelled to use one. it is the only thing he is fit for." -- oscar wilde |
From: martin f k. <ma...@ma...> - 2006-08-05 23:47:18
|
also sprach Michael Foord <fuz...@vo...> [2006.08.06.0020 +010= 0]: > *However*, I can easily expose an equivalent of html_parts -so you could= =20 > do : >=20 > <% include_rest('filename.txt', encoding) %> >=20 > Do you need this ? Well, of course I would prefer to define footer.txt in RST, and the only sensible place to include footer.txt is template.txt. :) But this is low priority... --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 # vim:tw=3D70 |
From: Michael F. <fuz...@vo...> - 2006-08-05 23:17:33
|
martin f krafft wrote: > also sprach Michael Foord <fuz...@vo...> [2006.07.30.2239 +0100]: > >> You use it by putting the following in your templates : >> >> <% include('filename.txt') %> >> >> or : >> >> <# print include('filename.txt') #> >> >> You *can* pass absolute or relative paths, but if you just pass a >> filename it will go up the directory tree of your site looking for the file. >> >> Seems to work... It should be possible to nest them, but filenames will >> be resolved from the start directory (lowest point)... >> > > Just tried this now and it works like a charm, except... > > filename.txt is included verbatim. I guess that makes sense, but it > would also be great if I could just include an RST file and have it > processed before inclusion. > > I realise RST has an include directive itself, but what if I want to > include an RST file from template.txt? > Then you need to use templating tags for rest documents : <$ include('filename.txt') $> See 'templating.txt' about the two different sorts of templating tags. :-) You will only be able to use this inside *pages* though, not inside 'template.txt', which is never processed for ReST. (You want to include ReST in your HTML template !?!?). *However*, I can easily expose an equivalent of html_parts -so you could do : <% include_rest('filename.txt', encoding) %> Do you need this ? Michael http://www.voidspace.org.uk/python/index.shtml |
From: martin f k. <ma...@ma...> - 2006-08-05 22:22:18
|
also sprach martin f krafft <ma...@ma...> [2006.08.05.2234 +0100]: > The code I use for template.txt is below. as I keep developing it... http://svn.madduck.net/phd/web/ --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 i must confess, I was born at a very early age. -- groucho marx |
From: martin f k. <ma...@ma...> - 2006-08-05 21:42:30
|
also sprach martin f krafft <ma...@ma...> [2006.08.04.1454 +0100]: > here's another question for you... take a look at > http://ailab.ch.org and take note of the section tabs on the left > hand side... if you click on one, it gets you to the subsection and > then stays highlighted. FWIW, I got it working the way I want it (I think), see http://martin-krafft.net/phd/ . The CSS that makes it look good (IMHO at least) is http://martin-krafft.net/phd/css/screen.css . The code I use for template.txt is below. The system works with uservalues to be defined in the base page of a category: uservalues category_name: Contact category_prio: 99 /uservalues Both values are optional, but at least one has to exist, or else the system does not recognise the page as a category definition. If the name is left out, the link_title (or page_title) is used. If the priority is left out, 50 is used. Tabs are sorted according to priority, then category name. This can probable be improved, and added to functions.py at one point. Thanks, Michael, for your help! <div id=3D"nav"> <# def category_list(indextree): l =3D [] uv =3D indextree.get('uservalues', {}) if uv.has_key('category_name') \ or uv.has_key('category_prio'): prio =3D uv.get('category_prio', 'default') if prio =3D=3D 'default': prio =3D 50 l.append((int(prio),=20 uv.get('category_name', indextree['link-title']), indextree['target'], indextree['thispage'])) if indextree['pages'] is not None: for p in indextree['pages']: l +=3D category_list(p) l.sort() return l def is_current_category(page, category): p =3D page while p is not None: uv =3D p.get('uservalues', {}) cat_name =3D uv.get('category_name', p['link-title']) if cat_name =3D=3D category: # only return true for the site root if the current page is the s= ite # root. if we ended up at the site root because no matching categ= ory # was found, return false return p['target'] =3D=3D page['target'] or p.get('parent') is no= t None p =3D p.get('parent', None) return False l =3D category_list(indextree) if len(l) > 0: print '<ul id=3D"global-links">' from sys import stdout for i in l: print '<li' if is_current_category(thispage, i[1]): print ' class=3D"current"' print '><a href=3D"%s">%s</a></li>' % (i[2], i[1]) #> </div> --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "they that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- benjamin franklin |
From: martin f k. <ma...@ma...> - 2006-08-05 21:05:43
|
Michael, I see restutils.encode uses the string encode function. I don't think this is what you want. < madduck> so i am baffled < madduck> >>> type('bla'.encode('utf-8')) < madduck> <type 'str'> < cracki> encode returns 8 bit < madduck> or even worse, < madduck> >>> type(u'bla'.encode('utf-8')) < madduck> <type 'str'> < cracki> you want unicode("bla") < cracki> encode encodes to binary representations < madduck> what's the point of "encode('utf-8')" then? < cracki> unicode("foo", "utf-8") < cracki> encode(u"someunicodestr", "weirdencoding") transforms to a=20 binary representation < cracki> in memory, unicode strings are multibyte, constant width Please also see http://docs.python.org/tut/node5.html#SECTION005130000000000000000 http://www.reportlab.com/i18n/python_unicode_tutorial.html The reason I am posting this is because I am getting an error UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2555: ordinal not in range(128) This is due to a file that says "Z=FCrich", and the file itself is UTF-8, as is the template: lapse:~/phd/web> head -15 imprint.txt = [390] restindex encoding: utf8 template-encoding:=20 /restindex [...] 8050 Z=FCrich The exception is thrown in line 75 of embedded_code.py: template =3D template.replace(occ, value) when template holds the template text just after body had been filled in with the result from the imprint.txt transformed to HTML. Template is a str, not a unicode object, which is the root of all evil. Am I doing something wrong? --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "violence is the last refuge of the incompetent" -- isaac asimov |