Skip to content

Commit

Permalink
update remote_pdf filename
Browse files Browse the repository at this point in the history
  • Loading branch information
laiwei committed Dec 13, 2012
1 parent 81f1ed1 commit 2a81a1d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion past/view/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def before_request():
g.config = config
g.user = auth_user_from_session(session)
g.user = User.get(2)
#g.user = User.get(2)
g.user_alias = UserAlias.gets_by_user_id(g.user.id) if g.user else None

if request.method == 'POST':
Expand Down
4 changes: 2 additions & 2 deletions tools/commpress_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ def file_visitor(args, dir_, files):
if not isinstance(files, list):
return
for f in files:
if not (f.startswith("thepast.me") and f.endswith(".pdf")):
if not (f.startswith("thepast.me_") and f.endswith(".pdf")):
continue
cmd = "cd ../var/down/pdf/ && tar -zcvf %s.tar.gz %s && rm %s" %(f, f, f)
print "---------", cmd
print "-----", cmd
print commands.getoutput(cmd)

os.path.walk("../var/down/pdf/", file_visitor, None)
4 changes: 2 additions & 2 deletions tools/remove_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ def file_visitor(args, dir_, files):
if not isinstance(files, list):
return
for f in files:
if not (f.startswith("thepast.me") and f.endswith(".pdf")):
if not (f.startswith("thepast.me") and f.endswith(".pdf.tar.gz")):
continue
user_id = int(f.split("_")[1])
if user_id not in user_ids:
pendding.add(user_id)
print pendding, len(pendding)
for user_id in pendding:
print '---deleting pdf of', user_id
os.popen("rm ../var/down/pdf/thepast.me_%s_2*.pdf" %user_id)
os.popen("rm ../var/down/pdf/thepast.me_%s_2*.pdf.tar.gz" %user_id)

os.path.walk("../var/down/pdf/", file_visitor, None)

0 comments on commit 2a81a1d

Please sign in to comment.