no more deprecated .has_key(...)
This commit is contained in:
@@ -576,7 +576,7 @@ def bg_graph_model():
|
|||||||
meta_graphmodel = dict(group=request.application, color='#ECECEC')
|
meta_graphmodel = dict(group=request.application, color='#ECECEC')
|
||||||
|
|
||||||
group = meta_graphmodel['group'].replace(' ', '')
|
group = meta_graphmodel['group'].replace(' ', '')
|
||||||
if not subgraphs.has_key(group):
|
if group not in subgraphs:
|
||||||
subgraphs[group] = dict(meta=meta_graphmodel, tables=[])
|
subgraphs[group] = dict(meta=meta_graphmodel, tables=[])
|
||||||
subgraphs[group]['tables'].append(tablename)
|
subgraphs[group]['tables'].append(tablename)
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
{{=peekfile('views',c, dict(id=id))}}
|
{{=peekfile('views',c, dict(id=id))}}
|
||||||
</span>
|
</span>
|
||||||
<span class="extras celled celled-one">
|
<span class="extras celled celled-one">
|
||||||
{{if extend.has_key(c):}}{{=T("extends")}} <b>{{=extend[c]}}</b> {{pass}}
|
{{if c in extend:}}{{=T("extends")}} <b>{{=extend[c]}}</b> {{pass}}
|
||||||
{{if include[c]:}}{{=T("includes")}} {{pass}}{{=XML(', '.join([B(f).xml() for f in include[c]]))}}
|
{{if include[c]:}}{{=T("includes")}} {{pass}}{{=XML(', '.join([B(f).xml() for f in include[c]]))}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
|
|||||||
{{=peekfile('views',c)}}
|
{{=peekfile('views',c)}}
|
||||||
</span>
|
</span>
|
||||||
<span class="extras celled">
|
<span class="extras celled">
|
||||||
{{if extend.has_key(c):}}{{=T("extends")}} <b>{{=extend[c]}}</b> {{pass}}
|
{{if c in extend:}}{{=T("extends")}} <b>{{=extend[c]}}</b> {{pass}}
|
||||||
{{if include[c]:}}{{=T("includes")}} {{pass}}{{=XML(', '.join([B(f).xml() for f in include[c]]))}}
|
{{if include[c]:}}{{=T("includes")}} {{pass}}{{=XML(', '.join([B(f).xml() for f in include[c]]))}}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -576,7 +576,7 @@ def bg_graph_model():
|
|||||||
meta_graphmodel = dict(group=request.application, color='#ECECEC')
|
meta_graphmodel = dict(group=request.application, color='#ECECEC')
|
||||||
|
|
||||||
group = meta_graphmodel['group'].replace(' ', '')
|
group = meta_graphmodel['group'].replace(' ', '')
|
||||||
if not subgraphs.has_key(group):
|
if group not in subgraphs:
|
||||||
subgraphs[group] = dict(meta=meta_graphmodel, tables=[])
|
subgraphs[group] = dict(meta=meta_graphmodel, tables=[])
|
||||||
subgraphs[group]['tables'].append(tablename)
|
subgraphs[group]['tables'].append(tablename)
|
||||||
|
|
||||||
|
|||||||
@@ -576,7 +576,7 @@ def bg_graph_model():
|
|||||||
meta_graphmodel = dict(group=request.application, color='#ECECEC')
|
meta_graphmodel = dict(group=request.application, color='#ECECEC')
|
||||||
|
|
||||||
group = meta_graphmodel['group'].replace(' ', '')
|
group = meta_graphmodel['group'].replace(' ', '')
|
||||||
if not subgraphs.has_key(group):
|
if group not in subgraphs:
|
||||||
subgraphs[group] = dict(meta=meta_graphmodel, tables=[])
|
subgraphs[group] = dict(meta=meta_graphmodel, tables=[])
|
||||||
subgraphs[group]['tables'].append(tablename)
|
subgraphs[group]['tables'].append(tablename)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -2643,7 +2643,7 @@ def test():
|
|||||||
>>> form=FORM(INPUT(value="Hello World", _name="var", requires=IS_MATCH('^\w+$')))
|
>>> form=FORM(INPUT(value="Hello World", _name="var", requires=IS_MATCH('^\w+$')))
|
||||||
>>> isinstance(form.as_dict(), dict)
|
>>> isinstance(form.as_dict(), dict)
|
||||||
True
|
True
|
||||||
>>> form.as_dict(flat=True).has_key("vars")
|
>>> "vars" in form.as_dict(flat=True)
|
||||||
True
|
True
|
||||||
>>> isinstance(form.as_json(), basestring) and len(form.as_json(sanitize=False)) > 0
|
>>> isinstance(form.as_json(), basestring) and len(form.as_json(sanitize=False)) > 0
|
||||||
True
|
True
|
||||||
|
|||||||
+2
-2
@@ -4219,7 +4219,7 @@ class Auth(object):
|
|||||||
if resolve:
|
if resolve:
|
||||||
if slug:
|
if slug:
|
||||||
wiki = self._wiki.read(slug, force_render)
|
wiki = self._wiki.read(slug, force_render)
|
||||||
if isinstance(wiki, dict) and wiki.has_key('content'): # FIXME: .has_key() is deprecated
|
if isinstance(wiki, dict) and 'content' in wiki:
|
||||||
# We don't want to return a dict object, just the wiki
|
# We don't want to return a dict object, just the wiki
|
||||||
wiki = wiki['content']
|
wiki = wiki['content']
|
||||||
else:
|
else:
|
||||||
@@ -5239,7 +5239,7 @@ class Service(object):
|
|||||||
|
|
||||||
def return_error(id, code, message=None, data=None):
|
def return_error(id, code, message=None, data=None):
|
||||||
error = {'code': code}
|
error = {'code': code}
|
||||||
if Service.jsonrpc_errors.has_key(code):
|
if code in Service.jsonrpc_errors:
|
||||||
error['message'] = Service.jsonrpc_errors[code][0]
|
error['message'] = Service.jsonrpc_errors[code][0]
|
||||||
error['data'] = Service.jsonrpc_errors[code][1]
|
error['data'] = Service.jsonrpc_errors[code][1]
|
||||||
if message is not None:
|
if message is not None:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ if __name__ == '__main__':
|
|||||||
freeze_support()
|
freeze_support()
|
||||||
except:
|
except:
|
||||||
sys.stderr.write('Sorry, -K only supported for python 2.6-2.7\n')
|
sys.stderr.write('Sorry, -K only supported for python 2.6-2.7\n')
|
||||||
if os.environ.has_key("COVERAGE_PROCESS_START"):
|
if "COVERAGE_PROCESS_START" in os.environ:
|
||||||
try:
|
try:
|
||||||
import coverage
|
import coverage
|
||||||
coverage.process_startup()
|
coverage.process_startup()
|
||||||
|
|||||||
Reference in New Issue
Block a user