some pep8 changes (fixed spacing at end)

This commit is contained in:
mdipierro
2012-10-19 10:37:07 -05:00
parent d552eb2eeb
commit b716df1a05
136 changed files with 12 additions and 653 deletions
+1 -1
View File
@@ -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
View File
@@ -1,12 +1 @@
+6 -8
View File
@@ -9,7 +9,11 @@ License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
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]
@@ -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
@@ -305,9 +309,3 @@ def main():
if __name__=='__main__':
main()
-6
View File
@@ -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
View File
@@ -0,0 +1 @@
+1
View File
@@ -0,0 +1 @@
@@ -441,7 +441,3 @@ def ccache():
return dict(form=form, total=total,
ram=ram, disk=disk, object_stats=hp != False)
-2
View File
@@ -198,5 +198,3 @@ def toggle_breakpoint():
except Exception, e:
session.flash = str(e)
return response.json({'ok': ok, 'lineno': lineno})
@@ -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
View File
@@ -89,6 +89,3 @@ def callback():
except:
errors=''
return (output+errors).replace('\n','<br/>')
@@ -80,6 +80,3 @@ def revision():
desc=ctx.description(),
form=form
)
@@ -58,4 +58,3 @@ class EXISTS(object):
if os.path.exists(value):
return (value,None)
return (value,self.error_message)
@@ -6,6 +6,3 @@ def index():
def about():
return locals()
-3
View File
@@ -43,6 +43,3 @@ def reset():
session['commands:'+app] = []
session['history:'+app] = gluon.contrib.shell.History()
return 'done'
@@ -27,6 +27,3 @@ def profiler():
size += len(data)
response.cookies[KEY] = size
return data
@@ -127,5 +127,3 @@ def detach_debugger():
def call():
session.forget()
return service()
-3
View File
@@ -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)
@@ -19,5 +19,3 @@ for filename in os.listdir(path):
os.unlink(fullpath)
except:
logging.exception('failure to check %s'%fullpath)
-3
View File
@@ -78,6 +78,3 @@ PLUGINS_APP = 'http://web2py.com/plugins'
# set the language
if 'adminLanguage' in request.cookies and not (request.cookies['adminLanguage'] is None):
T.force(request.cookies['adminLanguage'].value)
-3
View File
@@ -28,6 +28,3 @@ from gluon.languages import findT, update_all_languages
from gluon.myregex import *
from gluon.restricted import *
from gluon.compileapp import compile_application, remove_compiled_application
-2
View File
@@ -168,5 +168,3 @@ elif session.authorized and \
if request.controller=='appadmin' and DEMO_MODE:
session.flash = 'Appadmin disabled in demo mode'
redirect(URL('default','sites'))
-3
View File
@@ -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
View File
@@ -36,6 +36,3 @@ def is_manager():
return True
else:
return False
-3
View File
@@ -33,6 +33,3 @@ if os.path.exists('applications/examples'):
response.menu.append((T('Help'), False, URL('examples','default','index')))
else:
response.menu.append((T('Help'), False, 'http://web2py.com/examples'))
@@ -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
View File
@@ -1,2 +1 @@
+1
View File
@@ -0,0 +1 @@
@@ -18,7 +18,3 @@ def flash():
def fade():
return dict()
@@ -441,7 +441,3 @@ def ccache():
return dict(form=form, total=total,
ram=ram, disk=disk, object_stats=hp != False)
@@ -1,4 +1,3 @@
import time
@@ -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)
@@ -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))))
@@ -1,6 +1,3 @@
def form():
""" a simple entry form with various types of objects """
@@ -23,7 +20,3 @@ def form():
else:
response.flash = 'please fill the form'
return dict(form=form, vars=form.vars)
@@ -1,4 +1,3 @@
session.forget()
response.menu = [['home', False, '/%s/default/index'
@@ -77,7 +76,3 @@ def vars():
doc=doc,
attributes=attributes,
)
@@ -20,7 +20,3 @@ def basic():
['basic', True, URL('basic')]]
response.flash = 'you clicked on basic'
return dict(message='you clicked on basic')
@@ -1,6 +1,3 @@
def counter():
""" every time you reload, it increases the session.counter """
@@ -8,7 +5,3 @@ def counter():
session.counter = 0
session.counter += 1
return dict(counter=session.counter)
@@ -137,5 +137,3 @@ Quoted text
def ajaxwiki_onclick():
return MARKMIN(request.vars.text).xml()
@@ -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)
@@ -1,6 +1,3 @@
def variables():
return dict(a=10, b=20)
@@ -31,7 +28,3 @@ def xml():
def beautify():
return dict(message=BEAUTIFY(request))
@@ -1,4 +1,3 @@
def group_feed_reader(group,mode='div',counter='5'):
"""parse group feeds"""
@@ -43,8 +42,3 @@ def code_feed_reader(project,mode='div'):
return html
-2
View File
@@ -37,5 +37,3 @@ def get_content(b=None,\
openedfile.close()
return html
-2
View File
@@ -42,5 +42,3 @@ def toggle_menuclass(cssclass='pressed',menuid='headermenu'):
return XML(jscript)
else:
return ''
+1
View File
@@ -0,0 +1 @@
@@ -441,7 +441,3 @@ def ccache():
return dict(form=form, total=total,
ram=ram, disk=disk, object_stats=hp != False)
@@ -71,4 +71,3 @@ def data():
LOAD('default','data.load',args='tables',ajax=True,user_signature=True)
"""
return dict(form=crud())
-1
View File
@@ -81,4 +81,3 @@ use_janrain(auth,filename='private/janrain.key')
## after defining tables, uncomment below to enable auditing
# auth.enable_record_versioning(db)
-2
View File
@@ -98,5 +98,3 @@ def _():
]
)]
_()
-1
View File
@@ -37,4 +37,3 @@ routers = {
#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
View File
@@ -61,9 +61,3 @@ sys.path = [path]+[p for p in sys.path if not p==path]
import gluon.main
wsgiref.handlers.CGIHandler().run(gluon.main.wsgibase)
-6
View File
@@ -51,9 +51,3 @@ if SOFTCRON:
global_settings.web2py_crontype = 'soft'
fcgi.WSGIServer(application, bindAddress='/tmp/fcgi.sock').run()
-6
View File
@@ -97,9 +97,3 @@ def main():
if __name__ == '__main__':
main()
-12
View File
@@ -42,15 +42,3 @@ if 0:
mail = Mail()
service = Service()
plugins = PluginManager()
-8
View File
@@ -474,11 +474,3 @@ def create_missing_app_folders(request):
if not os.path.exists(path):
os.mkdir(path)
global_settings.app_folders.add(request.folder)
-4
View File
@@ -489,7 +489,3 @@ def lazy_cache(key=None,time_expire=None,cache_model='ram'):
g.__name__ = f.__name__
return g
return decorator
-8
View File
@@ -51,11 +51,3 @@ def getcfs(key, filename, filter=None):
cfs[key] = (t, data)
cfs_lock.release()
return data
-8
View File
@@ -700,11 +700,3 @@ def test():
if __name__ == '__main__':
import doctest
doctest.testmod()
-8
View File
@@ -717,11 +717,3 @@ def contenttype(filename, default='text/plain'):
if default.startswith('text/'):
default += '; charset=utf-8'
return default
-8
View File
@@ -257,11 +257,3 @@ def test():
if __name__=='__main__':
test()
-8
View File
@@ -237,11 +237,3 @@ def test():
if __name__=='__main__':
test()
-8
View File
@@ -1,9 +1 @@
-3
View File
@@ -500,6 +500,3 @@ aes_Rcon = array('B',
'c697356ad4b37dfaefc5913972e4d3bd'
'61c29f254a943366cc831d3a74e8cb'.decode('hex')
)
-3
View File
@@ -203,6 +203,3 @@ if __name__=="__main__":
print expand_html(open(sys.argv[1]).read())
else:
print test()
-7
View File
@@ -3905,10 +3905,3 @@ def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, refer
result['version'] = result['version'] or feedparser.version
result['namespaces'] = feedparser.namespacesInUse
return result
-1
View File
@@ -65,4 +65,3 @@ class MemcacheClient(object):
def flush_all(self,*a,**b):
return self.client.delete(*a,**b)
-8
View File
@@ -84,11 +84,3 @@ def autoretry_datastore_timeouts(attempts=5.0, interval=0.1, exponent=2.0):
setattr(wrapper, '_autoretry_datastore_timeouts', False)
if getattr(wrapped, '_autoretry_datastore_timeouts', True):
apiproxy_stub_map.MakeSyncCall = wrapper
-8
View File
@@ -61,11 +61,3 @@ def pdf_from_html(html):
return pdflatex_from_html(html)
else:
return pyfpdf_from_html(html)
-8
View File
@@ -13,11 +13,3 @@ def button(merchant_id="123456789012345",
list_products += t % dict(k=k+1,key=key,value=value)
button = '<form action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/%s" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" target="_top">%s<input name="_charset_" type="hidden" value="utf-8"/><input alt="" src="https://checkout.google.com/buttons/buy.gif?merchant_id=%s&amp;w=117&amp;h=48&amp;style=white&amp;variant=text&amp;loc=en_US" type="image"/></form>' % (merchant_id, list_products, merchant_id)
return XML(button)
-8
View File
@@ -3,11 +3,3 @@
__all__ = ['DAL','Field','drivers','gae']
from gluon.dal import DAL, Field, Table, Query, Set, Expression, Row, Rows, drivers, BaseAdapter, SQLField, SQLTable, SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL, SQLCustomType, gae
-3
View File
@@ -57,6 +57,3 @@ def THUMB(image, nx=120, ny=120, gae=False, name='thumb'):
return thumb
else:
return image
-8
View File
@@ -905,11 +905,3 @@ SQLStorage = DALStorage
if __name__ == '__main__':
import doctest
doctest.testmod()
-8
View File
@@ -121,11 +121,3 @@ def authenticate(username, password, service='login'):
if __name__ == "__main__":
import getpass
print authenticate(getpass.getuser(), getpass.getpass())
-3
View File
@@ -128,6 +128,3 @@ def test():
if __name__ == '__main__':
test()
-8
View File
@@ -165,11 +165,3 @@ if __name__ == '__main__':
ell=Learner()
ell.loadd(eval(IUP))
print ell.generate(1000,prefix=None)
-2
View File
@@ -9,5 +9,3 @@ from fpdf import *
# import warnings
# warnings.warn("pyfpdf package name is deprecated, please use fpdf instead")
-5
View File
@@ -961,8 +961,3 @@ if __name__ == '__main__':
# reimport as global __main__ namespace is destroyed
import qdb
qdb.main(**kwargs)
-6
View File
@@ -163,9 +163,3 @@ class RedisClient(object):
def __keyFormat__(self, key):
return 'w2p:%s:%s' % (self.request.application,
key.replace(' ', '_'))
-2
View File
@@ -197,5 +197,3 @@ class RecordDeleter(object):
self.db.srem(id_idx, self.key)
#remove the key itself
self.db.delete(self.key)
-8
View File
@@ -586,11 +586,3 @@ def test():
if __name__ == '__main__':
print test()
-8
View File
@@ -264,11 +264,3 @@ def run(history, statement, env={}):
if __name__=='__main__':
history=History()
while True: print run(history, raw_input('>>> ')).rstrip()
-5
View File
@@ -148,8 +148,3 @@ if __name__ == "__main__":
location = "http://www.web2py.com.ar/webservices/sample/call/jsonrpc"
client = ServerProxy(location, verbose='--verbose' in sys.argv,)
print client.add(1, 2)
-8
View File
@@ -110,11 +110,3 @@ def sms_email(number,provider):
elif number[:2]=='00': number=number[3:]
number=re.sub('[^\d]','',number)
return number+SMSCODES[provider]
-4
View File
@@ -877,7 +877,3 @@ if __name__ == '__main__':
s.cell('b', value="=sin(a)")
s.cell('c', value="=cos(a)**2+b*b")
print s['c'].computed_value
-6
View File
@@ -62,9 +62,3 @@ if __name__=='__main__':
print 'paid',s['paid'],s['amount'] ,s['currency']
s = Stripe(key).refund(d[u'id'])
print 'refunded',s['refunded']
-8
View File
@@ -241,11 +241,3 @@ class TaskBarIcon:
RUNNING = 0
STOPPED = 1
-4
View File
@@ -93,7 +93,3 @@ if __name__=='__main__':
print('')
# You can turn off ordering of results
print(t.getReportText(orderByCost=False))
-6
View File
@@ -516,9 +516,3 @@ class mobilize(object):
items.insert(-1,'mobile')
current.response.view = '.'.join(items)
return self.func()
-3
View File
@@ -200,6 +200,3 @@ def test_web2py_registration_and_login():
if __name__ == '__main__':
test_web2py_registration_and_login()
-8
View File
@@ -188,11 +188,3 @@ if __name__ == "__main__":
http_server = tornado.httpserver.HTTPServer(application)
http_server.listen(int(options.port), address=options.address)
tornado.ioloop.IOLoop.instance().start()
-1
View File
@@ -188,4 +188,3 @@ class TrackImporter(object):
return file
TRACK_IMPORTER = TrackImporter()
-1
View File
@@ -9548,4 +9548,3 @@ DAL.Table = Table # was necessary in gluon/globals.py session.connect
if __name__ == '__main__':
import doctest
doctest.testmod()
-5
View File
@@ -189,8 +189,3 @@ qdb_debugger.set_params(dict(call_stack=True, environment=True))
import gluon.main
gluon.main.global_settings.debugging = True
-8
View File
@@ -72,11 +72,3 @@ def autoDetectXMLEncoding(buffer):
def decoder(buffer):
encoding = autoDetectXMLEncoding(buffer)
return buffer.decode(encoding).encode('utf8')
-4
View File
@@ -395,7 +395,3 @@ def abspath(*relpath, **base):
if gluon:
return os.path.join(global_settings.gluon_parent, path)
return os.path.join(global_settings.applications_parent, path)
-1
View File
@@ -751,4 +751,3 @@ class Session(Storage):
del response.session_file
except:
pass
-8
View File
@@ -342,11 +342,3 @@ if __name__ == '__main__':
argfp.close()
print '<html><body>' + highlight(data, sys.argv[2])\
+ '</body></html>'
-1
View File
@@ -2535,4 +2535,3 @@ class MARKMIN(XmlComponent):
if __name__ == '__main__':
import doctest
doctest.testmod()
-8
View File
@@ -149,11 +149,3 @@ def redirect(location, how=303, client_side=False):
raise HTTP(how,
'You are being redirected <a href="%s">here</a>' % loc,
Location=loc)
-8
View File
@@ -107,11 +107,3 @@ for module in base_modules + contributed_modules:
msg += "Try the following command: "
msg += "easy_install-%(python_version)s -U %(module)s" % locals()
raise ImportError, msg
-1
View File
@@ -905,4 +905,3 @@ def update_all_languages(application_path):
if __name__ == '__main__':
import doctest
doctest.testmod()
-2
View File
@@ -857,5 +857,3 @@ class HttpServer(object):
os.unlink(self.pid_filename)
except:
pass
-3
View File
@@ -13,6 +13,3 @@ class MessageBoxHandler(logging.Handler):
if tkMessageBox:
msg = self.format(record)
tkMessageBox.showinfo('info1', msg)

Some files were not shown because too many files have changed in this diff Show More