releng r927 - in trunk/tools: . schedule



Author: ovitters
Date: Fri Jan 11 22:21:35 2008
New Revision: 927
URL: http://svn.gnome.org/viewvc/releng?rev=927&view=rev

Log:
	* schedule/libschedule.py: Look for the schedule file first in cwd,
	then in the directory of the py files. Ensures cron job will work.



Modified:
   trunk/tools/ChangeLog
   trunk/tools/schedule/libschedule.py

Modified: trunk/tools/schedule/libschedule.py
==============================================================================
--- trunk/tools/schedule/libschedule.py	(original)
+++ trunk/tools/schedule/libschedule.py	Fri Jan 11 22:21:35 2008
@@ -3,6 +3,9 @@
 import datetime
 import re
 import string
+import os
+import os.path
+import sys
 
 class GnomeReleaseEvent:
     definitions = {}
@@ -173,7 +176,10 @@
     return found
 
 def parse_file (filename):
-    file = open (filename, 'r')
+    try:
+        file = open(filename, 'r')
+    except IOError:
+        file = open(os.path.join(os.path.abspath(sys.path[0] or os.curdir), filename), 'r')
     lines = file.readlines ()
     file.close ()
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]