1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

pep8 cleanup pass

This commit is contained in:
Ilya Kreymer 2014-07-20 18:26:16 -07:00
parent e4297ddabe
commit fa813bdd19
8 changed files with 11 additions and 10 deletions

View File

@ -18,7 +18,7 @@ def create_app():
result, unknown = parser.parse_known_args()
config=dict(proxyhostport=result.proxy, framed_replay=True)
config = dict(proxyhostport=result.proxy, framed_replay=True)
app = init_app(create_live_rewriter_app, load_yaml=False,
config=config)

View File

@ -72,7 +72,6 @@ class ArchivalRouter(object):
return wbrequest
def render_home_page(self, env):
# render the homepage!
if self.home_view:

View File

@ -56,7 +56,8 @@ class ProxyRouter(object):
self.auth_msg = routing_options.get('auth_msg',
'Please enter name of a collection to use for proxy mode')
self.proxy_coll_select = routing_options.get('proxy_coll_select', False)
self.proxy_coll_select = routing_options.get('proxy_coll_select',
False)
def __call__(self, env):
url = env['REL_REQUEST_URI']

View File

@ -160,7 +160,7 @@ class RewriteContent:
first_buff=first_buff)
@staticmethod
def _decode_buff(buff, stream, encoding): # pragma: no coverage
def _decode_buff(buff, stream, encoding): # pragma: no coverage
try:
buff = buff.decode(encoding)
except UnicodeDecodeError, e:

View File

@ -81,8 +81,6 @@ class UrlRewriter(object):
if new_url.startswith(self.prefix):
new_url = new_url[len(self.prefix):]
#new_wburl = copy.copy(self.wburl)
#new_wburl.url = new_url
new_wburl = WbUrl(new_url)
return UrlRewriter(new_wburl, self.prefix)
@ -122,7 +120,6 @@ class UrlRewriter(object):
parts = (scheme, netloc, path, query, frag)
new_url = urlparse.urlunsplit(parts)
return new_url

View File

@ -215,7 +215,8 @@ def create_record_iter(arcv_iter, options):
not append_post):
continue
elif (not include_all and record.content_type == 'application/warc-fields'):
elif (not include_all and
record.content_type == 'application/warc-fields'):
continue
entry = parse_warc_record(record)
@ -226,7 +227,8 @@ def create_record_iter(arcv_iter, options):
continue
if entry.url and not entry.key:
entry.key = canonicalize(entry.url, options.get('surt_ordered', True))
entry.key = canonicalize(entry.url,
options.get('surt_ordered', True))
compute_digest = False

View File

@ -77,8 +77,10 @@ class SortedCDXWriter(CDXWriter):
return False
#=================================================================
ALLOWED_EXT = ('.arc', '.arc.gz', '.warc', '.warc.gz')
#=================================================================
def iter_file_or_dir(inputs):
for input_ in inputs:

View File

@ -72,7 +72,7 @@ class BaseContentView(object):
embed_url = wbrequest.wb_url.to_str(mod=self._mp_mod)
timestamp = datetime_to_timestamp(datetime.datetime.utcnow())
url = wbrequest.wb_url.url
ctype='text/html'
ctype = 'text/html'
return self.frame_insert_view.render_response(embed_url=embed_url,
wbrequest=wbrequest,