fixed some pep8 stuff

This commit is contained in:
mdipierro
2012-10-19 09:40:17 -05:00
parent de2337dfe3
commit d552eb2eeb
128 changed files with 267 additions and 140 deletions
@@ -444,3 +444,4 @@ def ccache():
+16 -15
View File
@@ -51,7 +51,7 @@ def interact():
lineno = web_debugger.lineno
if filename:
lines = dict([(i+1, l) for (i, l) in enumerate(
[l.strip("\n").strip("\r") for l
[l.strip("\n").strip("\r") for l
in open(filename).readlines()])])
filename = os.path.basename(filename)
else:
@@ -76,9 +76,9 @@ def interact():
response.flash = T('"User Exception" debug mode. '
'An error ticket could be issued!')
return dict(app=app, data="",
filename=web_debugger.filename, lines=lines, lineno=lineno,
f_globals=f_globals, f_locals=f_locals,
return dict(app=app, data="",
filename=web_debugger.filename, lines=lines, lineno=lineno,
f_globals=f_globals, f_locals=f_locals,
exception=web_debugger.exception_info)
def step():
@@ -120,8 +120,8 @@ def breakpoints():
# Get all .py files
files = listdir(apath('', r=request), '.*\.py$')
files = [filename for filename in files
if filename and 'languages' not in filename
files = [filename for filename in files
if filename and 'languages' not in filename
and not filename.startswith("admin")
and not filename.startswith("examples")]
@@ -129,16 +129,16 @@ def breakpoints():
Field('filename', requires=IS_IN_SET(files), label=T("Filename")),
Field('lineno', 'integer', label=T("Line number"),
requires=IS_NOT_EMPTY()),
Field('temporary', 'boolean', label=T("Temporary"),
Field('temporary', 'boolean', label=T("Temporary"),
comment=T("deleted after first hit")),
Field('condition', 'string', label=T("Condition"),
comment=T("honored only if the expression evaluates to true")),
)
if form.accepts(request.vars, session):
filename = os.path.join(request.env['applications_parent'],
filename = os.path.join(request.env['applications_parent'],
'applications', form.vars.filename)
err = qdb_debugger.do_set_breakpoint(filename,
err = qdb_debugger.do_set_breakpoint(filename,
form.vars.lineno,
form.vars.temporary,
form.vars.condition)
@@ -150,9 +150,9 @@ def breakpoints():
qdb_debugger.do_clear(item[7:])
breakpoints = [{'number': bp[0], 'filename': os.path.basename(bp[1]),
'path': bp[1], 'lineno': bp[2],
'temporary': bp[3], 'enabled': bp[4], 'hits': bp[5],
'condition': bp[6]}
'path': bp[1], 'lineno': bp[2],
'temporary': bp[3], 'enabled': bp[4], 'hits': bp[5],
'condition': bp[6]}
for bp in qdb_debugger.do_list_breakpoint()]
return dict(breakpoints=breakpoints, form=form)
@@ -160,11 +160,11 @@ def breakpoints():
def toggle_breakpoint():
"Set or clear a breakpoint"
lineno = None
ok = None
try:
filename = os.path.join(request.env['applications_parent'],
filename = os.path.join(request.env['applications_parent'],
'applications', request.vars.filename)
if not request.vars.data:
# ace send us the line number!
@@ -184,7 +184,7 @@ def toggle_breakpoint():
no, bp_filename, bp_lineno, temporary, enabled, hits, cond = bp
if filename == bp_filename and lineno == bp_lineno:
err = qdb_debugger.do_clear_breakpoint(filename, lineno)
response.flash = T("Removed Breakpoint on %s at line %s", (
response.flash = T("Removed Breakpoint on %s at line %s", (
filename, lineno))
ok = False
break
@@ -199,3 +199,4 @@ def toggle_breakpoint():
session.flash = str(e)
return response.json({'ok': ok, 'lineno': lineno})
+10 -9
View File
@@ -213,7 +213,7 @@ def site():
else:
session.flash = \
DIV(T('unable to create application "%s"' % appname),
PRE(error))
PRE(error))
redirect(URL(r=request))
elif form_update.accepted:
@@ -241,18 +241,18 @@ def site():
DIV(T('Unable to download app because:'),PRE(str(e)))
redirect(URL(r=request))
fname = form_update.vars.url
elif form_update.accepted and form_update.vars.file:
fname = request.vars.file.filename
f = request.vars.file.file
else:
session.flash = 'No file uploaded and no URL specified'
redirect(URL(r=request))
if f:
appname = cleanpath(form_update.vars.name)
installed = app_install(appname, f,
installed = app_install(appname, f,
request, fname,
overwrite=form_update.vars.overwrite)
if f and installed:
@@ -282,7 +282,7 @@ def site():
apps = sorted(apps,lambda a,b:cmp(a.upper(),b.upper()))
return dict(app=None, apps=apps, myversion=myversion,
return dict(app=None, apps=apps, myversion=myversion,
form_create=form_create, form_update=form_update)
@@ -340,7 +340,7 @@ def pack_plugin():
def upgrade_web2py():
dialog = FORM.confirm(T('Upgrade'),
{T('Cancel'):URL('site')})
{T('Cancel'):URL('site')})
if dialog.accepted:
(success, error) = upgrade(request)
if success:
@@ -355,7 +355,7 @@ def uninstall():
dialog = FORM.confirm(T('Uninstall'),
{T('Cancel'):URL('site')})
if dialog.accepted:
if MULTI_USER_MODE:
if is_manager() and db(db.app.name==app).delete():
@@ -1227,7 +1227,7 @@ def create_file():
if request.vars.plugin and not filename.startswith('plugin_%s/' % request.vars.plugin):
filename = 'plugin_%s/%s' % (request.vars.plugin, filename)
text = ''
else:
redirect(request.vars.sender+anchor)
@@ -1641,7 +1641,7 @@ def git_pull():
session.flash = GIT_MISSING
redirect(URL('site'))
dialog = FORM.confirm(T('Pull'),
{T('Cancel'):URL('site')})
{T('Cancel'):URL('site')})
if dialog.accepted:
try:
repo = Repo(os.path.join(apath(r=request),app))
@@ -1698,3 +1698,4 @@ def git_push():
redirect(URL('site'))
return dict(app=app,form=form)
+1
View File
@@ -91,3 +91,4 @@ def callback():
return (output+errors).replace('\n','<br/>')
@@ -82,3 +82,4 @@ def revision():
)
+4 -3
View File
@@ -26,7 +26,7 @@ def deploy():
kill()
except:
pass
ignore_apps = [item for item in apps if not item in form.vars.applications]
regex = re.compile('\(applications/\(.*')
w2p_origin = os.getcwd()
@@ -44,13 +44,13 @@ def deploy():
#shutil.copytree(appsrc,appdest)
index.add(['wsgi/'+osname+'/applications/'+i])
new_commit = index.commit("Deploy from Web2py IDE")
origin = repo.remotes.origin
origin.push
origin.push()
#Git code ends here
return dict(form=form,command=cmd)
class EXISTS(object):
def __init__(self, error_message='file not found'):
self.error_message = error_message
@@ -58,3 +58,4 @@ class EXISTS(object):
if os.path.exists(value):
return (value,None)
return (value,self.error_message)
@@ -8,3 +8,4 @@ def about():
return locals()
+1
View File
@@ -45,3 +45,4 @@ def reset():
return 'done'
@@ -29,3 +29,4 @@ def profiler():
return data
@@ -90,7 +90,7 @@ def attach_debugger(host='localhost', port=6000, authkey='secret password'):
if isinstance(authkey, unicode):
authkey = authkey.encode('utf8')
if not hasattr(gluon.debug, 'qdb_listener'):
# create a remote debugger server and wait for connection
address = (host, port) # family is deduced to be 'AF_INET'
@@ -128,3 +128,4 @@ def call():
session.forget()
return service()
+1
View File
@@ -556,3 +556,4 @@ def call(): return service()
os.unlink(file)
+3 -2
View File
@@ -13,9 +13,9 @@ TEXT_EDITOR = 'codemirror' or 'ace' or 'edit_area' or 'amy'
## Editor Color scheme (only for ace)
TEXT_EDITOR_THEME = (
"chrome", "clouds", "clouds_midnight", "cobalt", "crimson_editor", "dawn",
"chrome", "clouds", "clouds_midnight", "cobalt", "crimson_editor", "dawn",
"dreamweaver", "eclipse", "idle_fingers", "kr_theme", "merbivore",
"merbivore_soft", "monokai", "mono_industrial", "pastel_on_dark",
"merbivore_soft", "monokai", "mono_industrial", "pastel_on_dark",
"solarized_dark", "solarized_light", "textmate", "tomorrow",
"tomorrow_night", "tomorrow_night_blue", "tomorrow_night_bright",
"tomorrow_night_eighties", "twilight", "vibrant_ink")[0]
@@ -80,3 +80,4 @@ if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage']
T.force(request.cookies['adminLanguage'].value)
+1
View File
@@ -30,3 +30,4 @@ from gluon.restricted import *
from gluon.compileapp import compile_application, remove_compiled_application
+2 -1
View File
@@ -147,7 +147,7 @@ if request.controller == "webservices":
time.sleep(10)
raise HTTP(403,"Not authorized")
elif not session.authorized and not \
(request.controller+'/'+request.function in
(request.controller+'/'+request.function in
('default/index','default/user','plugin_jqmobile/index','plugin_jqmobile/about')):
if request.env.query_string:
@@ -169,3 +169,4 @@ if request.controller=='appadmin' and DEMO_MODE:
session.flash = 'Appadmin disabled in demo mode'
redirect(URL('default','sites'))
+1
View File
@@ -36,3 +36,4 @@ def searchbox(elementid):
return TAG[''](LABEL(IMG(_id="search_start",_src=URL('static', 'images/search.png'), _alt=T('filter')), _class='icon', _for=elementid), ' ', INPUT(_id=elementid, _type='text', _size=12))
+1
View File
@@ -38,3 +38,4 @@ def is_manager():
return False
+2 -1
View File
@@ -26,7 +26,7 @@ if not session.authorized:
else:
response.menu.append((T('Logout'), False,
URL(_a,'default',f='logout')))
response.menu.append((T('Debug'), False,
response.menu.append((T('Debug'), False,
URL(_a, 'debug','interact')))
if os.path.exists('applications/examples'):
@@ -35,3 +35,4 @@ else:
response.menu.append((T('Help'), False, 'http://web2py.com/examples'))
@@ -3,3 +3,4 @@ response.files.append(URL('static','plugin_multiselect/multi-select.css'))
response.files.append(URL('static','plugin_multiselect/start.js'))