some pep8 changes (fixed spacing at end)

This commit is contained in:
mdipierro
2012-10-19 10:37:07 -05:00
parent 3a66f5e330
commit 71ec15190b
136 changed files with 12 additions and 653 deletions
-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)
-8
View File
@@ -26,11 +26,3 @@ regex_include = re.compile(\
regex_extend = re.compile(\
'^\s*(?P<all>\{\{\s*extend\s+[\'"](?P<name>[^\'"]+)[\'"]\s*\}\})',re.MULTILINE)
-8
View File
@@ -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()
-5
View File
@@ -161,8 +161,3 @@ if __name__=='__main__':
f = LockedFile('test.txt',mode='rb')
print f.read()
f.close()
-8
View File
@@ -1711,11 +1711,3 @@ ADAPTERS = {
}
ADAPTERS['all'] = reduce(lambda a,b:a.union(b),(x for x in ADAPTERS.values()))
-8
View File
@@ -305,11 +305,3 @@ def snapshot(info=None, context=5, code=None, environment=None):
s[k] = BEAUTIFY(v)
return s
-1
View File
@@ -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
-6
View File
@@ -1876,9 +1876,3 @@ def demo():
if __name__=='__main__':
demo()
-8
View File
@@ -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)
-1
View File
@@ -962,4 +962,3 @@ def main():
if __name__=='__main__':
main()
-8
View File
@@ -111,11 +111,3 @@ def rss(feed):
pubDate=entry.get('created_on', now)
) for entry in feed.get('entries',[])])
return rss2.dumps(rss)
-3
View File
@@ -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
-8
View File
@@ -424,11 +424,3 @@ def execute_from_command_line(argv=None):
if __name__ == '__main__':
execute_from_command_line()
-8
View File
@@ -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
-1
View File
@@ -2747,4 +2747,3 @@ class ExporterXML(ExportClass):
out.write('</row>\n')
out.write('</rows>')
return str(out.getvalue())
-8
View File
@@ -258,11 +258,3 @@ class List(list):
if __name__ == '__main__':
import doctest
doctest.testmod()
-1
View File
@@ -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)
-8
View File
@@ -889,11 +889,3 @@ def render(content = "hello world",
if __name__ == '__main__':
import doctest
doctest.testmod()
-6
View File
@@ -5022,9 +5022,3 @@ class Wiki(object):
if __name__ == '__main__':
import doctest
doctest.testmod()
-4
View File
@@ -652,7 +652,3 @@ if __name__ == '__main__':
print "DOCTESTS FINISHED"
doctests()
-8
View File
@@ -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
-9
View File
@@ -3248,12 +3248,3 @@ class IS_IPV4(Validator):
if __name__ == '__main__':
import doctest
doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)
-10
View File
@@ -1218,13 +1218,3 @@ end tell
except:
pass
logging.shutdown()
-8
View File
@@ -166,11 +166,3 @@ def web2py_windows_service_handler(argv=None, opt_file='options'):
if __name__ == '__main__':
web2py_windows_service_handler()
-8
View File
@@ -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)