Thread: [Rest2web-develop] I think I have found a (minor) bug in r2w.py
Brought to you by:
mjfoord
From: Eur I. C. G. <cl...@is...> - 2007-03-09 11:05:14
|
I have been trying to 'tidy' up my use of rest2web so I have created different .ini files for different projects. Thus I have created a .ini file for the rest2web documentation tree which I have called (surprise!) docs.ini. If you enter:- r2w.py docs.ini It starts up OK but fails as follows:- ... ... ... Building functions.html Skipping "functions.html". Identical file exists. Building introduction.html Skipping "introduction.html". Identical file exists. Building macros.html [err] Traceback (most recent call last): [err] File "./r2w.py", line 170, in ? [err] count = main(options, config) [err] File "./r2w.py", line 103, in main [err] return processor.walk() [err] File "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 473, in walk [err] errorcheck = self.execute_safely(self.buildsection) [err] File "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 218, in execute_safely [err] val = function(*args, **keywargs) [err] File "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 1452, in buildsection [err] namespace['body'] = textmacros.replace_all( [err] File "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 207, in replace_all [err] return tm.expand(text) [err] File "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 202, in expand [err] return self.expand_tree(tree) [err] File "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 147, in expand_tree [err] expanded = self.eval_macro(text) [err] File "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 184, in eval_macro [err] return str(f(*args)) [err] File "/usr/lib/python2.4/site-packages/rest2web/defaultmacros.py", line 120, in include [err] data = open(os.path.expanduser(filename), 'r').read() [err] IOError: [Errno 2] No such file or directory: 'r2w.ini' [err] Note that if you happen to have just copied r2w.ini to docs.ini and the r2w.ini still exists you don't get the error of course. It only happens when there's no r2w.ini at all. It looks as if there's a "r2w.ini" hard coded somewhere that it shouldn't be I guess. -- Chris Green |
From: Michael F. <fuz...@vo...> - 2007-03-09 12:48:33
|
Eur Ing Chris Green wrote: > I have been trying to 'tidy' up my use of rest2web so I have created > different .ini files for different projects. Thus I have created a > .ini file for the rest2web documentation tree which I have called > (surprise!) docs.ini. > > If you enter:- > > r2w.py docs.ini > > It starts up OK but fails as follows:- > > ... > ... > ... > Building functions.html > Skipping "functions.html". Identical file exists. > Building introduction.html > Skipping "introduction.html". Identical file exists. > Building macros.html > [err] Traceback (most recent call last): > [err] File "./r2w.py", line 170, in ? > [err] count = main(options, config) > [err] File "./r2w.py", line 103, in main > [err] return processor.walk() > [err] File > "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 473, in walk > [err] errorcheck = self.execute_safely(self.buildsection) > [err] File > "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 218, in execute_safely > [err] val = function(*args, **keywargs) > [err] File > "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 1452, in buildsection > [err] namespace['body'] = textmacros.replace_all( > [err] File > "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 207, in replace_all > [err] return tm.expand(text) > [err] File > "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 202, in expand > [err] return self.expand_tree(tree) > [err] File > "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 147, in expand_tree > [err] expanded = self.eval_macro(text) > [err] File > "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 184, in eval_macro > [err] return str(f(*args)) > [err] File > "/usr/lib/python2.4/site-packages/rest2web/defaultmacros.py", line 120, in include > [err] data = open(os.path.expanduser(filename), 'r').read() > [err] IOError: [Errno 2] No such file or directory: 'r2w.ini' > [err] > > > Note that if you happen to have just copied r2w.ini to docs.ini and > the r2w.ini still exists you don't get the error of course. It only > happens when there's no r2w.ini at all. > > It looks as if there's a "r2w.ini" hard coded somewhere that it > shouldn't be I guess. > > Right - this is just an example of the 'include' macro - which includes the config file inside a page. If you just grep for 'r2w.ini' in the docs you should be able to find it and edit it. Fuzzyman http://www.voidspace.org.uk/python/index.shtml |
From: Eur I. C. G. <cl...@is...> - 2007-03-09 13:17:11
|
On Fri, Mar 09, 2007 at 12:48:26PM +0000, Michael Foord wrote: > Eur Ing Chris Green wrote: > > I have been trying to 'tidy' up my use of rest2web so I have created > > different .ini files for different projects. Thus I have created a > > .ini file for the rest2web documentation tree which I have called > > (surprise!) docs.ini. > > > > If you enter:- > > > > r2w.py docs.ini > > > > It starts up OK but fails as follows:- > > > > ... > > ... > > ... > > Building functions.html > > Skipping "functions.html". Identical file exists. > > Building introduction.html > > Skipping "introduction.html". Identical file exists. > > Building macros.html > > [err] Traceback (most recent call last): > > [err] File "./r2w.py", line 170, in ? > > [err] count = main(options, config) > > [err] File "./r2w.py", line 103, in main > > [err] return processor.walk() > > [err] File > > "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 473, in walk > > [err] errorcheck = self.execute_safely(self.buildsection) > > [err] File > > "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 218, in execute_safely > > [err] val = function(*args, **keywargs) > > [err] File > > "/usr/lib/python2.4/site-packages/rest2web/restprocessor.py", line 1452, in buildsection > > [err] namespace['body'] = textmacros.replace_all( > > [err] File > > "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 207, in replace_all > > [err] return tm.expand(text) > > [err] File > > "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 202, in expand > > [err] return self.expand_tree(tree) > > [err] File > > "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 147, in expand_tree > > [err] expanded = self.eval_macro(text) > > [err] File > > "/usr/lib/python2.4/site-packages/rest2web/textmacros.py", line 184, in eval_macro > > [err] return str(f(*args)) > > [err] File > > "/usr/lib/python2.4/site-packages/rest2web/defaultmacros.py", line 120, in include > > [err] data = open(os.path.expanduser(filename), 'r').read() > > [err] IOError: [Errno 2] No such file or directory: 'r2w.ini' > > [err] > > > > > > Note that if you happen to have just copied r2w.ini to docs.ini and > > the r2w.ini still exists you don't get the error of course. It only > > happens when there's no r2w.ini at all. > > > > It looks as if there's a "r2w.ini" hard coded somewhere that it > > shouldn't be I guess. > > > > > Right - this is just an example of the 'include' macro - which includes > the config file inside a page. > > If you just grep for 'r2w.ini' in the docs you should be able to find it > and edit it. > Aha, yes I see, it's just a consequence of that being the documentation and actually doing an include of r2w.ini as an example. -- Chris Green |