some pep8 changes (fixed spacing at end)
This commit is contained in:
@@ -42,15 +42,3 @@ if 0:
|
||||
mail = Mail()
|
||||
service = Service()
|
||||
plugins = PluginManager()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -489,7 +489,3 @@ def lazy_cache(key=None,time_expire=None,cache_model='ram'):
|
||||
g.__name__ = f.__name__
|
||||
return g
|
||||
return decorator
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -51,11 +51,3 @@ def getcfs(key, filename, filter=None):
|
||||
cfs[key] = (t, data)
|
||||
cfs_lock.release()
|
||||
return data
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -700,11 +700,3 @@ def test():
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -717,11 +717,3 @@ def contenttype(filename, default='text/plain'):
|
||||
if default.startswith('text/'):
|
||||
default += '; charset=utf-8'
|
||||
return default
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -257,11 +257,3 @@ def test():
|
||||
|
||||
if __name__=='__main__':
|
||||
test()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -237,11 +237,3 @@ def test():
|
||||
|
||||
if __name__=='__main__':
|
||||
test()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -500,6 +500,3 @@ aes_Rcon = array('B',
|
||||
'c697356ad4b37dfaefc5913972e4d3bd'
|
||||
'61c29f254a943366cc831d3a74e8cb'.decode('hex')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -203,6 +203,3 @@ if __name__=="__main__":
|
||||
print expand_html(open(sys.argv[1]).read())
|
||||
else:
|
||||
print test()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -65,4 +65,3 @@ class MemcacheClient(object):
|
||||
|
||||
def flush_all(self,*a,**b):
|
||||
return self.client.delete(*a,**b)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -61,11 +61,3 @@ def pdf_from_html(html):
|
||||
return pdflatex_from_html(html)
|
||||
else:
|
||||
return pyfpdf_from_html(html)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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&w=117&h=48&style=white&variant=text&loc=en_US" type="image"/></form>' % (merchant_id, list_products, merchant_id)
|
||||
return XML(button)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -57,6 +57,3 @@ def THUMB(image, nx=120, ny=120, gae=False, name='thumb'):
|
||||
return thumb
|
||||
else:
|
||||
return image
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -905,11 +905,3 @@ SQLStorage = DALStorage
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -121,11 +121,3 @@ def authenticate(username, password, service='login'):
|
||||
if __name__ == "__main__":
|
||||
import getpass
|
||||
print authenticate(getpass.getuser(), getpass.getpass())
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -128,6 +128,3 @@ def test():
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -165,11 +165,3 @@ if __name__ == '__main__':
|
||||
ell=Learner()
|
||||
ell.loadd(eval(IUP))
|
||||
print ell.generate(1000,prefix=None)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,5 +9,3 @@ from fpdf import *
|
||||
|
||||
# import warnings
|
||||
# warnings.warn("pyfpdf package name is deprecated, please use fpdf instead")
|
||||
|
||||
|
||||
|
||||
@@ -961,8 +961,3 @@ if __name__ == '__main__':
|
||||
# reimport as global __main__ namespace is destroyed
|
||||
import qdb
|
||||
qdb.main(**kwargs)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -163,9 +163,3 @@ class RedisClient(object):
|
||||
def __keyFormat__(self, key):
|
||||
return 'w2p:%s:%s' % (self.request.application,
|
||||
key.replace(' ', '_'))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -197,5 +197,3 @@ class RecordDeleter(object):
|
||||
self.db.srem(id_idx, self.key)
|
||||
#remove the key itself
|
||||
self.db.delete(self.key)
|
||||
|
||||
|
||||
|
||||
@@ -586,11 +586,3 @@ def test():
|
||||
|
||||
if __name__ == '__main__':
|
||||
print test()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -264,11 +264,3 @@ def run(history, statement, env={}):
|
||||
if __name__=='__main__':
|
||||
history=History()
|
||||
while True: print run(history, raw_input('>>> ')).rstrip()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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']
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -241,11 +241,3 @@ class TaskBarIcon:
|
||||
|
||||
RUNNING = 0
|
||||
STOPPED = 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -93,7 +93,3 @@ if __name__=='__main__':
|
||||
print('')
|
||||
# You can turn off ordering of results
|
||||
print(t.getReportText(orderByCost=False))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -516,9 +516,3 @@ class mobilize(object):
|
||||
items.insert(-1,'mobile')
|
||||
current.response.view = '.'.join(items)
|
||||
return self.func()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -200,6 +200,3 @@ def test_web2py_registration_and_login():
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_web2py_registration_and_login()
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -188,4 +188,3 @@ class TrackImporter(object):
|
||||
return file
|
||||
|
||||
TRACK_IMPORTER = TrackImporter()
|
||||
|
||||
|
||||
@@ -9548,4 +9548,3 @@ DAL.Table = Table # was necessary in gluon/globals.py session.connect
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
||||
|
||||
@@ -189,8 +189,3 @@ qdb_debugger.set_params(dict(call_stack=True, environment=True))
|
||||
|
||||
import gluon.main
|
||||
gluon.main.global_settings.debugging = True
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -72,11 +72,3 @@ def autoDetectXMLEncoding(buffer):
|
||||
def decoder(buffer):
|
||||
encoding = autoDetectXMLEncoding(buffer)
|
||||
return buffer.decode(encoding).encode('utf8')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -751,4 +751,3 @@ class Session(Storage):
|
||||
del response.session_file
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
@@ -342,11 +342,3 @@ if __name__ == '__main__':
|
||||
argfp.close()
|
||||
print '<html><body>' + highlight(data, sys.argv[2])\
|
||||
+ '</body></html>'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2535,4 +2535,3 @@ class MARKMIN(XmlComponent):
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -905,4 +905,3 @@ def update_all_languages(application_path):
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
||||
|
||||
@@ -857,5 +857,3 @@ class HttpServer(object):
|
||||
os.unlink(self.pid_filename)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,3 @@ class MessageBoxHandler(logging.Handler):
|
||||
if tkMessageBox:
|
||||
msg = self.format(record)
|
||||
tkMessageBox.showinfo('info1', msg)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,11 +26,3 @@ regex_include = re.compile(\
|
||||
|
||||
regex_extend = re.compile(\
|
||||
'^\s*(?P<all>\{\{\s*extend\s+[\'"](?P<name>[^\'"]+)[\'"]\s*\}\})',re.MULTILINE)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -341,11 +341,3 @@ def crondance(applications_parent, ctype='soft', startup=False, apps=None):
|
||||
'WEB2PY CRON: Execution error for %s: %s' \
|
||||
% (task.get('cmd'), e))
|
||||
token.release()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -161,8 +161,3 @@ if __name__=='__main__':
|
||||
f = LockedFile('test.txt',mode='rb')
|
||||
print f.read()
|
||||
f.close()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1711,11 +1711,3 @@ ADAPTERS = {
|
||||
}
|
||||
|
||||
ADAPTERS['all'] = reduce(lambda a,b:a.union(b),(x for x in ADAPTERS.values()))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -305,11 +305,3 @@ def snapshot(info=None, context=5, code=None, environment=None):
|
||||
s[k] = BEAUTIFY(v)
|
||||
|
||||
return s
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1316,4 +1316,3 @@ def get_effective_router(appname):
|
||||
if not routers or appname not in routers:
|
||||
return None
|
||||
return Storage(routers[appname]) # return a copy
|
||||
|
||||
|
||||
@@ -1876,9 +1876,3 @@ def demo():
|
||||
|
||||
if __name__=='__main__':
|
||||
demo()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -222,11 +222,3 @@ def sanitize(text, permitted_tags=[
|
||||
if not isinstance(text, str): return str(text)
|
||||
return XssCleaner(permitted_tags=permitted_tags,
|
||||
allowed_attributes=allowed_attributes).strip(text, escape)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -962,4 +962,3 @@ def main():
|
||||
|
||||
if __name__=='__main__':
|
||||
main()
|
||||
|
||||
|
||||
@@ -111,11 +111,3 @@ def rss(feed):
|
||||
pubDate=entry.get('created_on', now)
|
||||
) for entry in feed.get('entries',[])])
|
||||
return rss2.dumps(rss)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,3 @@ global_settings.is_jython = \
|
||||
'java' in sys.platform.lower() or \
|
||||
hasattr(sys, 'JYTHON_JAR') or \
|
||||
str(sys.copyright).find('Jython') > 0
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -424,11 +424,3 @@ def execute_from_command_line(argv=None):
|
||||
|
||||
if __name__ == '__main__':
|
||||
execute_from_command_line()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,11 +3,3 @@
|
||||
__all__ = ['DAL','Field','DRIVERS']
|
||||
|
||||
from dal import DAL, Field, Table, Query, Set, Expression, Row, Rows, DRIVERS, BaseAdapter, SQLField, SQLTable, SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL, SQLCustomType
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2747,4 +2747,3 @@ class ExporterXML(ExportClass):
|
||||
out.write('</row>\n')
|
||||
out.write('</rows>')
|
||||
return str(out.getvalue())
|
||||
|
||||
|
||||
@@ -258,11 +258,3 @@ class List(list):
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -118,4 +118,3 @@ def stream_file_or_304_or_206(
|
||||
else:
|
||||
wrapped = streamer(stream, chunk_size=chunk_size, bytes=bytes)
|
||||
raise HTTP(status, wrapped, **headers)
|
||||
|
||||
|
||||
@@ -889,11 +889,3 @@ def render(content = "hello world",
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5022,9 +5022,3 @@ class Wiki(object):
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -652,7 +652,3 @@ if __name__ == '__main__':
|
||||
print "DOCTESTS FINISHED"
|
||||
|
||||
doctests()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -254,11 +254,3 @@ def is_valid_ip_address(address):
|
||||
return False
|
||||
else: # do not know what to do? assume it is a valid address
|
||||
return True
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3248,12 +3248,3 @@ class IS_IPV4(Validator):
|
||||
if __name__ == '__main__':
|
||||
import doctest
|
||||
doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1218,13 +1218,3 @@ end tell
|
||||
except:
|
||||
pass
|
||||
logging.shutdown()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -166,11 +166,3 @@ def web2py_windows_service_handler(argv=None, opt_file='options'):
|
||||
|
||||
if __name__ == '__main__':
|
||||
web2py_windows_service_handler()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,11 +19,3 @@ def handler(request, response, methods):
|
||||
response.headers['Content-Type'] = 'text/xml'
|
||||
dispatch = getattr(dispatcher, '_dispatch', None)
|
||||
return dispatcher._marshaled_dispatch(request.body.read(), dispatch)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user