You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2015/09/11 19:58:46 UTC
svn commit: r1702527 - /comdev/reporter.apache.org/trunk/readjira.py
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)) ]