community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1702527 - /comdev/reporter.apache.org/trunk/readjira.py
Date Fri, 11 Sep 2015 17:58:46 GMT
Author: sebb
Date: Fri Sep 11 17:58:45 2015
New Revision: 1702527

URL: http://svn.apache.org/r1702527
Log:
Work out home location automatically

Modified:
    comdev/reporter.apache.org/trunk/readjira.py

Modified: comdev/reporter.apache.org/trunk/readjira.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/readjira.py?rev=1702527&r1=1702526&r2=1702527&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/readjira.py (original)
+++ comdev/reporter.apache.org/trunk/readjira.py Fri Sep 11 17:58:45 2015
@@ -2,9 +2,11 @@
 
 import re, os, json, urllib2, base64, time
 from os import listdir
-from os.path import isfile, join
+from os.path import isfile, join, dirname, abspath
+from inspect import getsourcefile
 
-MYHOME = "/var/www/reporter.apache.org"
+# MYHOME = "/var/www/reporter.apache.org"
+MYHOME = dirname(abspath(getsourcefile(lambda:0))) # automatically work out home location
so can run the code anywhere
 mypath = "%s/data/JIRA" % MYHOME
 print("Scanning mypath=%s" % mypath)
 myfiles = [ f for f in listdir(mypath) if isfile(join(mypath,f)) ]



Mime
View raw message