Skip to content

Commit

Permalink
some pep8 changes (fixed spacing at end)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed Oct 19, 2012
1 parent 3a66f5e commit 71ec151
Show file tree
Hide file tree
Showing 136 changed files with 12 additions and 653 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
Version 2.1.1 (2012-10-19 09:40:10) dev
Version 2.1.1 (2012-10-19 10:37:01) dev
11 changes: 0 additions & 11 deletions __init__.py
@@ -1,12 +1 @@












14 changes: 6 additions & 8 deletions anyserver.py
Expand Up @@ -9,7 +9,11 @@
This file is based, although a rewrite, on MIT-licensed code from the Bottle web framework.
"""

import os, sys, optparse, urllib
import os
import sys
import optparse
import urllib

path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path)
sys.path = [path]+[p for p in sys.path if not p==path]
Expand Down Expand Up @@ -217,7 +221,7 @@ def mongrel2_handler(application,conn,debug=False):
environ['QUERY_STRING'] = environ['URI'].split('?')[1]
else:
environ['QUERY_STRING'] = ''
if environ.has_key('Content-Length'):
if 'Content-Length' in environ:
environ['CONTENT_LENGTH'] = environ['Content-Length'] # necessary for POST to work with Django
environ['wsgi.input'] = req.body

Expand Down Expand Up @@ -305,9 +309,3 @@ def main():

if __name__=='__main__':
main()






6 changes: 0 additions & 6 deletions appengine_config.py
Expand Up @@ -2,9 +2,3 @@ def webapp_add_wsgi_middleware(app):
from google.appengine.ext.appstats import recording
app = recording.appstats_wsgi_middleware(app)
return app






1 change: 1 addition & 0 deletions applications/__init__.py
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions applications/admin/__init__.py
@@ -0,0 +1 @@

4 changes: 0 additions & 4 deletions applications/admin/controllers/appadmin.py
Expand Up @@ -441,7 +441,3 @@ def key_table(keys):

return dict(form=form, total=total,
ram=ram, disk=disk, object_stats=hp != False)




2 changes: 0 additions & 2 deletions applications/admin/controllers/debug.py
Expand Up @@ -198,5 +198,3 @@ def toggle_breakpoint():
except Exception, e:
session.flash = str(e)
return response.json({'ok': ok, 'lineno': lineno})


2 changes: 0 additions & 2 deletions applications/admin/controllers/default.py
Expand Up @@ -1697,5 +1697,3 @@ def git_push():
session.flash = T("Push failed, git exited abnormally. See logs for details.")
redirect(URL('site'))
return dict(app=app,form=form)


3 changes: 0 additions & 3 deletions applications/admin/controllers/gae.py
Expand Up @@ -89,6 +89,3 @@ def callback():
except:
errors=''
return (output+errors).replace('\n','<br/>')



3 changes: 0 additions & 3 deletions applications/admin/controllers/mercurial.py
Expand Up @@ -80,6 +80,3 @@ def revision():
desc=ctx.description(),
form=form
)



1 change: 0 additions & 1 deletion applications/admin/controllers/openshift.py
Expand Up @@ -58,4 +58,3 @@ def __call__(self, value):
if os.path.exists(value):
return (value,None)
return (value,self.error_message)

3 changes: 0 additions & 3 deletions applications/admin/controllers/plugin_jqmobile.py
Expand Up @@ -6,6 +6,3 @@ def index():

def about():
return locals()



3 changes: 0 additions & 3 deletions applications/admin/controllers/shell.py
Expand Up @@ -43,6 +43,3 @@ def reset():
session['commands:'+app] = []
session['history:'+app] = gluon.contrib.shell.History()
return 'done'



3 changes: 0 additions & 3 deletions applications/admin/controllers/toolbar.py
Expand Up @@ -27,6 +27,3 @@ def profiler():
size += len(data)
response.cookies[KEY] = size
return data



2 changes: 0 additions & 2 deletions applications/admin/controllers/webservices.py
Expand Up @@ -127,5 +127,3 @@ def detach_debugger():
def call():
session.forget()
return service()


3 changes: 0 additions & 3 deletions applications/admin/controllers/wizard.py
Expand Up @@ -554,6 +554,3 @@ def call(): return service()
path = os.path.join(request.folder,'..',app,'databases','*')
for file in glob.glob(path):
os.unlink(file)



2 changes: 0 additions & 2 deletions applications/admin/cron/expire_sessions.py
Expand Up @@ -19,5 +19,3 @@
os.unlink(fullpath)
except:
logging.exception('failure to check %s'%fullpath)


3 changes: 0 additions & 3 deletions applications/admin/models/0.py
Expand Up @@ -78,6 +78,3 @@
# set the language
if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage'] is None):
T.force(request.cookies['adminLanguage'].value)



3 changes: 0 additions & 3 deletions applications/admin/models/0_imports.py
Expand Up @@ -28,6 +28,3 @@
from gluon.myregex import *
from gluon.restricted import *
from gluon.compileapp import compile_application, remove_compiled_application



2 changes: 0 additions & 2 deletions applications/admin/models/access.py
Expand Up @@ -168,5 +168,3 @@ def login_record(success=True):
if request.controller=='appadmin' and DEMO_MODE:
session.flash = 'Appadmin disabled in demo mode'
redirect(URL('default','sites'))


3 changes: 0 additions & 3 deletions applications/admin/models/buttons.py
Expand Up @@ -34,6 +34,3 @@ def helpicon():

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))



3 changes: 0 additions & 3 deletions applications/admin/models/db.py
Expand Up @@ -36,6 +36,3 @@ def is_manager():
return True
else:
return False



3 changes: 0 additions & 3 deletions applications/admin/models/menu.py
Expand Up @@ -33,6 +33,3 @@
response.menu.append((T('Help'), False, URL('examples','default','index')))
else:
response.menu.append((T('Help'), False, 'http://web2py.com/examples'))



3 changes: 0 additions & 3 deletions applications/admin/models/plugin_multiselect.py
@@ -1,6 +1,3 @@
response.files.append(URL('static','plugin_multiselect/jquery.multi-select.js'))
response.files.append(URL('static','plugin_multiselect/multi-select.css'))
response.files.append(URL('static','plugin_multiselect/start.js'))



1 change: 0 additions & 1 deletion applications/admin/modules/__init__.py
@@ -1,2 +1 @@


1 change: 1 addition & 0 deletions applications/examples/__init__.py
@@ -0,0 +1 @@

4 changes: 0 additions & 4 deletions applications/examples/controllers/ajax_examples.py
Expand Up @@ -18,7 +18,3 @@ def flash():

def fade():
return dict()




4 changes: 0 additions & 4 deletions applications/examples/controllers/appadmin.py
Expand Up @@ -441,7 +441,3 @@ def key_table(keys):

return dict(form=form, total=total,
ram=ram, disk=disk, object_stats=hp != False)




4 changes: 0 additions & 4 deletions applications/examples/controllers/cache_examples.py
@@ -1,4 +1,3 @@

import time


Expand Down Expand Up @@ -47,6 +46,3 @@ def cache_controller_and_view():
t = time.ctime()
d = dict(time=t, link=A('click to reload', _href=URL(r=request)))
return response.render(d)



2 changes: 0 additions & 2 deletions applications/examples/controllers/default.py
Expand Up @@ -73,5 +73,3 @@ def changelog():
import os
filename = os.path.join(request.env.gluon_parent, 'CHANGELOG')
return response.render(dict(changelog=MARKMIN(read_file(filename))))


7 changes: 0 additions & 7 deletions applications/examples/controllers/form_examples.py
@@ -1,6 +1,3 @@



def form():
""" a simple entry form with various types of objects """

Expand All @@ -23,7 +20,3 @@ def form():
else:
response.flash = 'please fill the form'
return dict(form=form, vars=form.vars)




5 changes: 0 additions & 5 deletions applications/examples/controllers/global.py
@@ -1,4 +1,3 @@

session.forget()

response.menu = [['home', False, '/%s/default/index'
Expand Down Expand Up @@ -77,7 +76,3 @@ def vars():
doc=doc,
attributes=attributes,
)




4 changes: 0 additions & 4 deletions applications/examples/controllers/layout_examples.py
Expand Up @@ -20,7 +20,3 @@ def basic():
['basic', True, URL('basic')]]
response.flash = 'you clicked on basic'
return dict(message='you clicked on basic')




7 changes: 0 additions & 7 deletions applications/examples/controllers/session_examples.py
@@ -1,14 +1,7 @@



def counter():
""" every time you reload, it increases the session.counter """

if not session.counter:
session.counter = 0
session.counter += 1
return dict(counter=session.counter)




2 changes: 0 additions & 2 deletions applications/examples/controllers/simple_examples.py
Expand Up @@ -137,5 +137,3 @@ def index: return 'hello world'

def ajaxwiki_onclick():
return MARKMIN(request.vars.text).xml()


2 changes: 0 additions & 2 deletions applications/examples/controllers/spreadsheet.py
Expand Up @@ -7,5 +7,3 @@ def index():
sheet = cache.ram('sheet1',lambda:Sheet(10,10,URL('callback')),0)
#sheet.cell('r0c3',value='=r0c0+r0c1+r0c2',readonly=True)
return dict(sheet=sheet)


7 changes: 0 additions & 7 deletions applications/examples/controllers/template_examples.py
@@ -1,6 +1,3 @@



def variables():
return dict(a=10, b=20)

Expand Down Expand Up @@ -31,7 +28,3 @@ def xml():

def beautify():
return dict(message=BEAUTIFY(request))




6 changes: 0 additions & 6 deletions applications/examples/models/feeds_reader.py
@@ -1,4 +1,3 @@

def group_feed_reader(group,mode='div',counter='5'):
"""parse group feeds"""

Expand Down Expand Up @@ -43,8 +42,3 @@ def code_feed_reader(project,mode='div'):


return html





2 changes: 0 additions & 2 deletions applications/examples/models/markmin.py
Expand Up @@ -37,5 +37,3 @@ def openfile():
openedfile.close()

return html


2 changes: 0 additions & 2 deletions applications/examples/models/menu.py
Expand Up @@ -42,5 +42,3 @@ def toggle_menuclass(cssclass='pressed',menuid='headermenu'):
return XML(jscript)
else:
return ''


1 change: 1 addition & 0 deletions applications/welcome/__init__.py
@@ -0,0 +1 @@

4 changes: 0 additions & 4 deletions applications/welcome/controllers/appadmin.py
Expand Up @@ -441,7 +441,3 @@ def key_table(keys):

return dict(form=form, total=total,
ram=ram, disk=disk, object_stats=hp != False)




1 change: 0 additions & 1 deletion applications/welcome/controllers/default.py
Expand Up @@ -71,4 +71,3 @@ def data():
LOAD('default','data.load',args='tables',ajax=True,user_signature=True)
"""
return dict(form=crud())

1 change: 0 additions & 1 deletion applications/welcome/models/db.py
Expand Up @@ -81,4 +81,3 @@

## after defining tables, uncomment below to enable auditing
# auth.enable_record_versioning(db)

2 changes: 0 additions & 2 deletions applications/welcome/models/menu.py
Expand Up @@ -98,5 +98,3 @@ def _():
]
)]
_()


1 change: 0 additions & 1 deletion applications/welcome/routes.example.py
Expand Up @@ -37,4 +37,3 @@
#NOTE! To change language in your application using these rules add this line
#in one of your models files:
# if request.uri_language: T.force(request.uri_language)

6 changes: 0 additions & 6 deletions cgihandler.py
Expand Up @@ -61,9 +61,3 @@
import gluon.main

wsgiref.handlers.CGIHandler().run(gluon.main.wsgibase)






6 changes: 0 additions & 6 deletions fcgihandler.py
Expand Up @@ -51,9 +51,3 @@
global_settings.web2py_crontype = 'soft'

fcgi.WSGIServer(application, bindAddress='/tmp/fcgi.sock').run()






6 changes: 0 additions & 6 deletions gaehandler.py
Expand Up @@ -97,9 +97,3 @@ def main():

if __name__ == '__main__':
main()






0 comments on commit 71ec151

Please sign in to comment.