[web2py] Re: problem whith admin
Daniel Gonzalez, The patch works well for me. Thanks Jose
Re: [web2py] Re: problem whith admin
I've applied your patch and it works, at least for i2p... thanks regards woiski 2010/11/15 Nico de Groot > I think the offending line is in design.html, see the ticket below. > (The 'real' line number is 207, because the python code is generated > by {{=...}}.) > > 289.if '/'.join(file_path).startswith('/'.join(path)): > > > At that point > > path: ['js', 'ckeditor', 'plugins', 'table'] > and > file_path: ['js', 'ckeditor', 'plugins', 'tableresize'] > > the joins in de code result in > > js/ckeditor/plugins/tableresize > and > js/ckeditor/plugins/table > > > I think line 289 intents to check if the 'path' is a 'path-prefix' > of 'file_path'. In this case the check resolves to True, but this > incorrect, because it is NOT a path-prefix causing line 290 to fail. > > line 289 should probably be something like: > >if ('/'.join(file_path)+'/').startswith('/'.join(path)+'/') or > path==[]: > > This seems to resolve at least my problem. Please test and confirm. > > Nico > - > Excerpt from my error-ticket: > > (list index out of range) > > File C:\web2py\applications\admin\views\default\design.html in > at line 290 > code > > Code listing > 282. response.write('\n \n', escape=False) > 283. path=[] > 284. for file in statics+['']: > 285.items=file.split('/') > 286.file_path=items[:-1] > 287.filename=items[-1] > 288.while path!=file_path: > 289.if '/'.join(file_path).startswith('/'.join(path)): > 290. path.append(file_path[len(path)]) > > > On 15 nov, 20:10, Branko Vukelic wrote: > > On Mon, Nov 15, 2010 at 8:59 PM, mdipierro > wrote: > > > where is the offending line in design.html? > > > > I think it's in this block: > > > > > > {{=T("Plugins")}} > > {{=helpicon()}} {{=T("To create a > > plugin, name a file/folder plugin_[name]")}} > > > > > > > > {{=button(PLUGINS_APP, T('download plugins'))}} > > > > > > > > {{if plugins:}} > > > > {{for plugin in plugins:}} > > > > {{=A('plugin_%s' % plugin, _class='file', _href=URL('plugin', > > args=[app, plugin]))}} > > > > {{pass}} > > > > {{else:}} > > {{=T('There are no plugins')}} > > {{pass}} > > {{=upload_plugin_form(app)}} > > <-- line 290 > > > > -- > > Branko Vukelić > > > > bg.bra...@gmail.com > > stu...@brankovukelic.com > > > > Check out my blog:http://www.brankovukelic.com/ > > Check out my portfolio:http://www.flickr.com/photos/foxbunny/ > > Registered Linux user #438078 (http://counter.li.org/) > > I hang out on identi.ca:http://identi.ca/foxbunny > > > > Gimp Brushmakers Guildhttp://bit.ly/gbg-group >
[web2py] Re: problem whith admin
Hello , I had the same pb : Traceback (most recent call last): File "/home/sylvain/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/sylvain/web2py/applications/admin/views/default/ design.html", line 290, in IndexError: list index out of range What I can say : I had Jqueryui folder in my /static and /plugin_wiki also When I remove jqueryui from /static it works fine... Don't know if it can helps, I wonder if it is a redondant file pb... On 15 nov, 22:43, Nico de Groot wrote: > I think the offending line is in design.html, see the ticket below. > (The 'real' line number is 207, because the python code is generated > by {{=...}}.) > > 289. if '/'.join(file_path).startswith('/'.join(path)): > > At that point > > path: ['js', 'ckeditor', 'plugins', 'table'] > and > file_path: ['js', 'ckeditor', 'plugins', 'tableresize'] > > the joins in de code result in > > js/ckeditor/plugins/tableresize > and > js/ckeditor/plugins/table > > I think line 289 intents to check if the 'path' is a 'path-prefix' > of 'file_path'. In this case the check resolves to True, but this > incorrect, because it is NOT a path-prefix causing line 290 to fail. > > line 289 should probably be something like: > > if ('/'.join(file_path)+'/').startswith('/'.join(path)+'/') or > path==[]: > > This seems to resolve at least my problem. Please test and confirm. > > Nico > - > Excerpt from my error-ticket: > > (list index out of range) > > File C:\web2py\applications\admin\views\default\design.html in > at line 290 > code > > Code listing > 282. response.write('\n \n ', escape=False) > 283. path=[] > 284. for file in statics+['']: > 285. items=file.split('/') > 286. file_path=items[:-1] > 287. filename=items[-1] > 288. while path!=file_path: > 289. if '/'.join(file_path).startswith('/'.join(path)): > 290. path.append(file_path[len(path)]) > > > On 15 nov, 20:10, Branko Vukelic wrote: > > > On Mon, Nov 15, 2010 at 8:59 PM, mdipierro wrote: > > > where is the offending line in design.html? > > > I think it's in this block: > > > > > {{=T("Plugins")}} > > {{=helpicon()}} {{=T("To create a > > plugin, name a file/folder plugin_[name]")}} > > > > > > > > {{=button(PLUGINS_APP, T('download plugins'))}} > > > > > > > > {{if plugins:}} > > > > {{for plugin in plugins:}} > > > > {{=A('plugin_%s' % plugin, _class='file', _href=URL('plugin', > > args=[app, plugin]))}} > > > > {{pass}} > > > > {{else:}} > > {{=T('There are no plugins')}} > > {{pass}} > > {{=upload_plugin_form(app)}} > > <-- line 290 > > > -- > > Branko Vukelić > > > bg.bra...@gmail.com > > stu...@brankovukelic.com > > > Check out my blog:http://www.brankovukelic.com/ > > Check out my portfolio:http://www.flickr.com/photos/foxbunny/ > > Registered Linux user #438078 (http://counter.li.org/) > > I hang out on identi.ca:http://identi.ca/foxbunny > > > Gimp Brushmakers Guildhttp://bit.ly/gbg-group > >
Re: [web2py] Re: problem whith admin
Hi, i had the same problem. To fix this while a new version is launched, you can edit the file applications/admin/views/default/design.html And go to line 207 where youl find if '/'.join(file_path).startswith('/'.join(path)): Try to chage it with if len(file_path)>= len(path) and all([ v==file_path[k] for k,v in enumerate(path)]): It worked for me. El lun, 15-11-2010 a las 13:43 -0800, Nico de Groot escribió: > I think the offending line is in design.html, see the ticket below. > (The 'real' line number is 207, because the python code is generated > by {{=...}}.) > > 289.if '/'.join(file_path).startswith('/'.join(path)): > > > At that point > >path: ['js', 'ckeditor', 'plugins', 'table'] > and >file_path: ['js', 'ckeditor', 'plugins', 'tableresize'] > > the joins in de code result in > > js/ckeditor/plugins/tableresize > and > js/ckeditor/plugins/table > > > I think line 289 intents to check if the 'path' is a 'path-prefix' > of 'file_path'. In this case the check resolves to True, but this > incorrect, because it is NOT a path-prefix causing line 290 to fail. > > line 289 should probably be something like: > > if ('/'.join(file_path)+'/').startswith('/'.join(path)+'/') or > path==[]: > > This seems to resolve at least my problem. Please test and confirm. > > Nico > - > Excerpt from my error-ticket: > > (list index out of range) > > File C:\web2py\applications\admin\views\default\design.html in > at line 290 > code > > Code listing > 282. response.write('\n \n', escape=False) > 283. path=[] > 284. for file in statics+['']: > 285.items=file.split('/') > 286.file_path=items[:-1] > 287.filename=items[-1] > 288.while path!=file_path: > 289.if '/'.join(file_path).startswith('/'.join(path)): > 290. path.append(file_path[len(path)]) > > > On 15 nov, 20:10, Branko Vukelic wrote: > > On Mon, Nov 15, 2010 at 8:59 PM, mdipierro wrote: > > > where is the offending line in design.html? > > > > I think it's in this block: > > > > > > {{=T("Plugins")}} > > {{=helpicon()}} {{=T("To create a > > plugin, name a file/folder plugin_[name]")}} > > > > > > > > {{=button(PLUGINS_APP, T('download plugins'))}} > > > > > > > > {{if plugins:}} > > > > {{for plugin in plugins:}} > > > > {{=A('plugin_%s' % plugin, _class='file', _href=URL('plugin', > > args=[app, plugin]))}} > > > > {{pass}} > > > > {{else:}} > > {{=T('There are no plugins')}} > > {{pass}} > > {{=upload_plugin_form(app)}} > > <-- line 290 > > > > -- > > Branko Vukelić > > > > bg.bra...@gmail.com > > stu...@brankovukelic.com > > > > Check out my blog:http://www.brankovukelic.com/ > > Check out my portfolio:http://www.flickr.com/photos/foxbunny/ > > Registered Linux user #438078 (http://counter.li.org/) > > I hang out on identi.ca:http://identi.ca/foxbunny > > > > Gimp Brushmakers Guildhttp://bit.ly/gbg-group
[web2py] Re: problem whith admin
I think the offending line is in design.html, see the ticket below. (The 'real' line number is 207, because the python code is generated by {{=...}}.) 289.if '/'.join(file_path).startswith('/'.join(path)): At that point path: ['js', 'ckeditor', 'plugins', 'table'] and file_path: ['js', 'ckeditor', 'plugins', 'tableresize'] the joins in de code result in js/ckeditor/plugins/tableresize and js/ckeditor/plugins/table I think line 289 intents to check if the 'path' is a 'path-prefix' of 'file_path'. In this case the check resolves to True, but this incorrect, because it is NOT a path-prefix causing line 290 to fail. line 289 should probably be something like: if ('/'.join(file_path)+'/').startswith('/'.join(path)+'/') or path==[]: This seems to resolve at least my problem. Please test and confirm. Nico - Excerpt from my error-ticket: (list index out of range) File C:\web2py\applications\admin\views\default\design.html in at line 290 code Code listing 282. response.write('\n \n', escape=False) 283. path=[] 284. for file in statics+['']: 285.items=file.split('/') 286.file_path=items[:-1] 287.filename=items[-1] 288.while path!=file_path: 289.if '/'.join(file_path).startswith('/'.join(path)): 290. path.append(file_path[len(path)]) On 15 nov, 20:10, Branko Vukelic wrote: > On Mon, Nov 15, 2010 at 8:59 PM, mdipierro wrote: > > where is the offending line in design.html? > > I think it's in this block: > > > {{=T("Plugins")}} > {{=helpicon()}} {{=T("To create a > plugin, name a file/folder plugin_[name]")}} > > > > {{=button(PLUGINS_APP, T('download plugins'))}} > > > > {{if plugins:}} > > {{for plugin in plugins:}} > > {{=A('plugin_%s' % plugin, _class='file', _href=URL('plugin', > args=[app, plugin]))}} > > {{pass}} > > {{else:}} > {{=T('There are no plugins')}} > {{pass}} > {{=upload_plugin_form(app)}} > <-- line 290 > > -- > Branko Vukelić > > bg.bra...@gmail.com > stu...@brankovukelic.com > > Check out my blog:http://www.brankovukelic.com/ > Check out my portfolio:http://www.flickr.com/photos/foxbunny/ > Registered Linux user #438078 (http://counter.li.org/) > I hang out on identi.ca:http://identi.ca/foxbunny > > Gimp Brushmakers Guildhttp://bit.ly/gbg-group
Re: [web2py] Re: problem whith admin
On Mon, Nov 15, 2010 at 8:59 PM, mdipierro wrote: > where is the offending line in design.html? I think it's in this block: {{=T("Plugins")}} {{=helpicon()}} {{=T("To create a plugin, name a file/folder plugin_[name]")}} {{=button(PLUGINS_APP, T('download plugins'))}} {{if plugins:}} {{for plugin in plugins:}} {{=A('plugin_%s' % plugin, _class='file', _href=URL('plugin', args=[app, plugin]))}} {{pass}} {{else:}} {{=T('There are no plugins')}} {{pass}} {{=upload_plugin_form(app)}} <-- line 290 -- Branko Vukelić bg.bra...@gmail.com stu...@brankovukelic.com Check out my blog: http://www.brankovukelic.com/ Check out my portfolio: http://www.flickr.com/photos/foxbunny/ Registered Linux user #438078 (http://counter.li.org/) I hang out on identi.ca: http://identi.ca/foxbunny Gimp Brushmakers Guild http://bit.ly/gbg-group
[web2py] Re: problem whith admin
where is the offending line in design.html? On Nov 15, 1:47 pm, Branko Vukelic wrote: > Probably a missing {{if something}} somewhere. Maybe {{for}} in > templates could be wrapped in an implicit if block. Like when you say: > > {{ for something in other}} > blah blah > {{pass}} > > could translate to: > > if other: > for something in other: > blah blah > > Would that be too much work, Massimo? > > > > On Mon, Nov 15, 2010 at 7:52 PM, Emanuel Woiski wrote: > > Hello > > I had the same problem, same message, when trying Instant Press (I have > > filled issue 12 there)! > > regards > > woiski > > > 2010/11/10 Jose > > >> I have to edit some applications problems with the new admin. With > >> some works without problems. In other gives the following error: > > >> Traceback (most recent call last): > >> File "/usr/home/jose/web2py/gluon/restricted.py", line 188, in > >> restricted > >> exec ccode in environment > >> File "/usr/home/jose/web2py/applications/admin/views/default/ > >> design.html", line 290, in > >> > >> IndexError: list index out of range > > >> Jose > > -- > Branko Vukelić > > bg.bra...@gmail.com > stu...@brankovukelic.com > > Check out my blog:http://www.brankovukelic.com/ > Check out my portfolio:http://www.flickr.com/photos/foxbunny/ > Registered Linux user #438078 (http://counter.li.org/) > I hang out on identi.ca:http://identi.ca/foxbunny > > Gimp Brushmakers Guildhttp://bit.ly/gbg-group