only load the resources/pkg_resources stuff if needed - slight optimization for importing without referencing the stylesheet
authorTero Marttila <terom@fixme.fi>
Sun, 14 Jun 2009 17:19:41 +0300
changeset 112 e990b7a54d40
parent 111 ecceaf23c969
child 113 3e0bbacc917e
only load the resources/pkg_resources stuff if needed - slight optimization for importing without referencing the stylesheet
degal/gallery.py
--- a/degal/gallery.py	Sun Jun 14 16:34:40 2009 +0300
+++ b/degal/gallery.py	Sun Jun 14 17:19:41 2009 +0300
@@ -2,7 +2,7 @@
     Top-level gallery state
 """
 
-import filesystem, folder, resources
+import filesystem, folder
 
 from utils import lazy_load
 
@@ -41,8 +41,11 @@
         stylesheet = self.degal_dir.subfile('style.css')
         
         if not stylesheet.exists() :
-            # copy it from resources
-            stylesheet.copy_from(resources.STATIC_DIR.subfile('style.css'))
+            # load the resources dir
+            from resource import STATIC_DIR
+
+            # copy it from the static resource file
+            stylesheet.copy_from(STATIC_DIR.subfile('style.css'))
 
         return stylesheet