Permalink
Browse files

allowing 50 chars for the name, and also removing slashes

  • Loading branch information...
billrest committed Jun 20, 2011
1 parent 797fac4 commit cd3695299a76659fc67e26ae19c9d5a4a2e0462f
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/funkload/ReportServer.py
@@ -52,7 +52,10 @@ def cgi_escape(s):
def get_report_dir(root, title):
- dirname = seed = title.lower().replace(' ', '-')[:16]
+ dirname = seed = title.lower().replace(' ', '-')
+ dirname = dirname.replace('/', '-')
+ dirname = dirname.replace('\\', '-')
+ seed = dirname = dirname[:50]
target = os.path.join(root, dirname)
count = 1
while os.path.exists(target):
@@ -276,11 +279,11 @@ def run_server(results_dir, reports_dir, port):
try:
httpd.serve_forever()
except KeyboardInterrupt:
- sys.exit(0)
+ return 0
except Exception, e:
print(e)
- sys.exit(1)
-
+ return 1
+ return 0
def main():
usage = '%prog result_dir [report_dir]'

0 comments on commit cd36952

Please sign in to comment.