You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by hu...@apache.org on 2019/11/20 18:19:01 UTC
svn commit: r1870053 -
/comdev/reporter.apache.org/trunk/scripts/rapp/drafts.py
Author: humbedooh
Date: Wed Nov 20 18:19:00 2019
New Revision: 1870053
URL: http://svn.apache.org/viewvc?rev=1870053&view=rev
Log:
fixups for empire-db et al
Modified:
comdev/reporter.apache.org/trunk/scripts/rapp/drafts.py
Modified: comdev/reporter.apache.org/trunk/scripts/rapp/drafts.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/rapp/drafts.py?rev=1870053&r1=1870052&r2=1870053&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/rapp/drafts.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/rapp/drafts.py Wed Nov 20 18:19:00 2019
@@ -32,6 +32,7 @@ def index(environ, user):
whence = int(time.time() - (60*86400)) # Max 2 months ago!
for filename in [x for x in os.listdir(DRAFTS_DIR) if x.startswith(EDITOR_TYPE) and x.endswith('.draft')]:
_e, p, t, u = filename.split('-', 3)
+ p = p.replace('_', '-')
t = int(t)
# If a file is way old, try deleting it.
if t < whence:
@@ -92,7 +93,7 @@ def save(environ, user):
if has_access(user, project):
report = js.get('report')
now = int(time.time())
- filename = '%s-%s-%s-%s.draft' % (EDITOR_TYPE, project, now, user)
+ filename = '%s-%s-%s-%s.draft' % (EDITOR_TYPE, project.replace('-', '_'), now, user)
try:
with open(os.path.join(DRAFTS_DIR, filename), "w") as f:
f.write(report)
@@ -154,6 +155,7 @@ def forgotten(environ, user):
for filename in drafts:
_e, p, t, u = filename.split('-', 3)
t = int(t)
+ p = p.replace('_', '-')
if p == rid and t > (time.time() - 45*86400):
applicables.append(filename)
if applicables: