Commits

Moises Henriquez committed c91b204

Completing setup.py and adding launcher script

  • Participants
  • Parent commits 236a4e5

Comments (0)

Files changed (4)

 setup(name='vpackager',
         version=version,
         description="vpackager compiles and installs software from source",
-        longg_description=long_description,
+        long_description=long_description,
         classifiers=[
             'Developemtn Status :: 4 - Beta',
             'Intended Audience :: End users, Developers',
         license='GNU GPL v3',
         packages=['vpackager'],
         package_dir={'vpackager': 'src/vpackager'},
-        package_data={'vpackager': ['data/*.png']},
-        zip_save=False)
+        package_data={'vpackager': ['data/*']},
+        install_requires=['psutil',
+            'sqlite3'
+            ],
+        scripts=['src/scripts/vpackager'],
+        zip_safe=False)
 
 

File src/scripts/vpackager

+#!/usr/bin/env python
+
+import gtk
+from vpackager import bot
+from vpackager import vpackager as vp
+import sys
+
+def RunBot():
+    """run vpackager in bot mode"""
+    w = bot.App()
+    return w
+
+def RunSolo():
+    """Run the application in single build mode"""
+    w = vp.Wizard()
+    return w
+
+if __name__ == '__main__':
+
+    if sys.argv[-1] == '-s':
+	w = RunSolo()
+    else:
+	w = RunBot()
+    w.show_all()
+    gtk.gdk.threads_init()
+    gtk.main()
+

File src/vpackager/bot.py

         gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
         self.set_title('vpackager')
         self.connect('destroy', self._exit)
-        datadir = os.path.join(
-                os.getcwd(),'data')
-        self.set_icon_from_file(os.path.join(
-            datadir, 'vpackager.png'))
+        datadir = os.path.dirname(os.path.abspath(__file__))
+        datadir = os.path.join(datadir, 'data')
+        self.set_icon_from_file(os.path.join(datadir, 'vpackager.png'))
         self.set_size_request(950, 500)
         self.body = gtk.VBox()
         # make sure the db is ok
         self._bot_run = False
         self.body.pack_start(self._get_menubar(), False, True, 4)
         self.body.pack_start(self._get_notebook(), True, True, 4)
-        #self.body.pack_start(self._get_bottombar(), False, False, 4)
 
         self.add(self.body)
 

File src/vpackager/guitools.py

         gtk.AboutDialog.__init__(self)
         self.set_name('vpackager')
         self.set_version('2.0')
+        datadir = os.path.dirname(os.path.abspath(__file__))
+        datadir = os.path.join(datadir, 'data')
         self.set_authors(['Moises Henriquez (M0E-Lnx)',
             'Rodrigo Bistolfi (rbistolfi)'])
-        f = open('data/LICENSE', 'r')
+        f = open(os.path.join(datadir, 'LICENSE'), 'r')
         self.set_license(f.read())
         f.close()
         self.set_website('https://bitbucket.org/m0e_lnx/vpackager')
         self.set_copyright('(c) 2008-2011 Moises Henriquez')
-        logo = gtk.gdk.pixbuf_new_from_file('data/vpackager_logo.png')
+        logo = gtk.gdk.pixbuf_new_from_file(
+                os.path.join(datadir, 'vpackager_logo.png'))
         self.set_logo(logo)
         self.set_comments("Compile software from source code.")