mirror of
https://github.com/postgres/pgweb.git
synced 2025-07-25 16:02:27 +00:00
Fix whitespace and indentation, per pep8
This commit is contained in:
@ -19,12 +19,14 @@ exclude_roots = ['/repos', ]
|
||||
|
||||
allnodes = {}
|
||||
|
||||
|
||||
def read_file(fn):
|
||||
f = codecs.open(fn, 'r', encoding='utf-8', errors='replace')
|
||||
t = f.read()
|
||||
f.close()
|
||||
return t
|
||||
|
||||
|
||||
def parse_directory(dirname, rootlen):
|
||||
mynode = {}
|
||||
for f in os.listdir(dirname):
|
||||
@ -39,7 +41,7 @@ def parse_directory(dirname, rootlen):
|
||||
mynode[f] = {
|
||||
't': 'l',
|
||||
'd': os.readlink(fn).strip("/"),
|
||||
}
|
||||
}
|
||||
else:
|
||||
# This is a subdirectory, recurse into it, unless it happens
|
||||
# to be on our exclude list.
|
||||
@ -61,6 +63,7 @@ def parse_directory(dirname, rootlen):
|
||||
|
||||
allnodes[dirname[rootlen:].strip("/")] = mynode
|
||||
|
||||
|
||||
def Usage():
|
||||
print "Usage: spider_ftp.py <ftp_root> <pickle_file>"
|
||||
print ""
|
||||
@ -68,6 +71,7 @@ def Usage():
|
||||
print "to that URL instead of written to the filesystem."
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if len(sys.argv) != 3: Usage()
|
||||
|
||||
parse_directory(sys.argv[1], len(sys.argv[1]))
|
||||
|
Reference in New Issue
Block a user