Commits

Moises Henriquez committed d60cb4f

Getting rid of hard coded paths

  • Participants
  • Parent commits 6613146

Comments (0)

Files changed (3)

File modules/support/widgets.py

 __author_email__ = "moc.liamg@xnl.E0M"[::-1]
 vlbluecolor = gtk.gdk.color_parse("#003063")
 vllightbluecolor = gtk.gdk.color_parse("#6d87a3")
-
+modulesdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+print modulesdir
 horizontal = gtk.HBox
 vertical = gtk.VBox
 
                                 self._parent_category, self.title))
                             self.add_option(vasm_mod)
 
-    def load_module(self, name, fname, path=["/home/vluser/devel/vasm/modules"]):
+    def load_module(self, name, fname, path=[modulesdir]):
         """ return a named module found in the given path"""
         mod = imp.find_module(name, path)
         ret = imp.load_module(name, mod[0], fname, mod[2])
 from optparse import OptionParser
 
 logger = logging.getLogger('vasm')
-
+modulesdir = os.path.join(os.getcwd(), 'modules')
 _ = utils._
 
 def get_category_image(category):
                         # Module has paseed the test.  Add to the views
                         self.add_option(vasm_mod)
 
-    def load_module(self, name, fname, path=["/home/vluser/devel/vasm/modules"]):
+    def load_module(self, name, fname, path=modulesdir):
         """ return a named module found in the given path"""
         mod = imp.find_module(name, path)
         ret = imp.load_module(name, mod[0], fname, mod[2])
 import logging
 
 _ = utils._
-
+modulesdir = os.path.join(os.getcwd(), "modules")
 logger = logging.getLogger('vasm')
 
 palette = widgets.palette
                         # Module has paseed the test.  Add to the views
                         self.add_option(vasm_mod)
 
-    def load_module(self, name, fname, path=["/home/vluser/devel/vasm/modules"]):
+    def load_module(self, name, fname, path=[modulesdir]):
         """ return a named module found in the given path"""
         mod = imp.find_module(name, path)
         ret = imp.load_module(name, mod[0], fname, mod[2])