[Buildbot-commits] buildbot/buildbot/status html.py,1.85,1.86

Brian Warner warner at users.sourceforge.net
Sat Jun 3 20:21:06 UTC 2006


Update of /cvsroot/buildbot/buildbot/buildbot/status
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15165/buildbot/status

Modified Files:
	html.py 
Log Message:
[project @ add py2exe support for windows, SF#1401121]

Original author: warner at lothar.com
Date: 2006-06-03 20:18:42

Index: html.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/html.py,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- html.py	2 Jun 2006 05:15:46 -0000	1.85
+++ html.py	3 Jun 2006 20:21:04 -0000	1.86
@@ -16,7 +16,7 @@
 
 from buildbot.twcompat import implements, Interface
 
-import string, types, time, os.path
+import sys, string, types, time, os.path
 
 from buildbot import interfaces, util
 from buildbot import version
@@ -1582,11 +1582,19 @@
 
         return NoResource("No such Builder '%s'" % path)
 
-# the icon is sibpath(__file__, "../buildbot.png") . This is for portability.
-up = os.path.dirname
-buildbot_icon = os.path.abspath(os.path.join(up(up(__file__)),
-                                             "buildbot.png"))
-buildbot_css = os.path.abspath(os.path.join(up(__file__), "classic.css"))
+if hasattr(sys, "frozen"):
+    # all 'data' files are in the directory of our executable
+    here = os.path.dirname(sys.executable)
+    buildbot_icon = os.path.abspath(os.path.join(here, "buildbot.png"))
+    buildbot_css = os.path.abspath(os.path.join(here, "classic.css"))
+else:
+    # running from source
+    # the icon is sibpath(__file__, "../buildbot.png") . This is for
+    # portability.
+    up = os.path.dirname
+    buildbot_icon = os.path.abspath(os.path.join(up(up(__file__)),
+                                                 "buildbot.png"))
+    buildbot_css = os.path.abspath(os.path.join(up(__file__), "classic.css"))
 
 class Waterfall(base.StatusReceiverMultiService):
     """I implement the primary web-page status interface, called a 'Waterfall





More information about the Commits mailing list