fixed a problem with missing OrderedDict

This commit is contained in:
Massimo Di Pierro
2011-12-09 21:05:11 -06:00
parent f0f8c8ce22
commit 2f7a7376c9
3 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.3 (2011-12-09 20:55:52) stable Version 1.99.3 (2011-12-09 21:05:04) stable
+2 -3
View File
@@ -3,10 +3,9 @@
EXPERIMENTAL_STUFF = True EXPERIMENTAL_STUFF = True
if EXPERIMENTAL_STUFF: if EXPERIMENTAL_STUFF:
is_mobile = True #request.user_agent().is_mobile is_mobile = request.user_agent().is_mobile
if is_mobile: if is_mobile:
response.view = response.view.replace( response.view = response.view.replace('default/','default.mobile/')
'default/','default.mobile/')
response.menu = [] response.menu = []
from gluon.admin import * from gluon.admin import *
@@ -170,8 +170,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
{{if not statics:}}<p><strong>{{=T("There are no static files")}}</strong></p>{{pass}} {{if not statics:}}<p><strong>{{=T("There are no static files")}}</strong></p>{{pass}}
<ul data-role="listview" data-inset="true"> <ul data-role="listview" data-inset="true">
{{ {{
from collections import OrderedDict tree={}
tree=OrderedDict()
for file in statics+['']: for file in statics+['']:
items=file.partition('/') items=file.partition('/')
if not items[0] in tree: if not items[0] in tree:
@@ -180,7 +179,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
tree[items[0]].append(items[2]) tree[items[0]].append(items[2])
pass pass
}} }}
{{for k, v in tree.iteritems():}} {{for k, v in sorted(tree.items()):}}
{{if k:}} {{if k:}}
<li><a>{{=k}}</a> <li><a>{{=k}}</a>
<ul data-theme='c'> <ul data-theme='c'>