Moises Henriquez avatar Moises Henriquez committed cf2a291

Fixed problem with creating SB for URL

Comments (0)

Files changed (6)

src/scripts/vpackager

 import gtk
 from vpackager import bot
 from vpackager import vpackager as vp
+from vpackager import dbutils
 import sys
 
 def RunBot():
     """run vpackager in bot mode"""
-    w = bot.App()
+    db = dbutils.dbase()
+    w = bot.Gui(dbase_model = db)
     return w
 
 def RunSolo():

src/vpackager/bot.py

             return
         _prevdir = os.getcwd()
         patchesdir = os.path.join(workdir, 'patches')
+        try:
+            os.makedirs(patchesdir)
+        except:
+            pass
         for patch in patchlist.split(','):
             if patch.startswith('/'):
                 shutil.copy2(patch, patchesdir)
             else:
                 os.chdir(patchesdir)
-                urllib.urlretrieve(patch)
+                # I need to determine the filename so we can save it.
+                self.print_to_log('\n   +++ Downloading patch: %s\n'% patch)
+                pname = patch.rsplit('/',1)[1]
+                urllib.urlretrieve(patch, pname)
         return os.chdir(_prevdir)
 
     def clear_textview(self):
                 return self.view.StopBot()
             #clear the textview()
             self.clear_textview()
-            job_info = self.model.GetJobDetails(str(job_id))
+            job_info = self.model.GetJobDetails(job_id)
+            # Create the appropriate build object
+            srcob = self.get_builder(job_info['srcURI'], job_info['id'])
             # Show the progress on the GUI
             self.view.IndicateBotRunning(app = job_info['app'],
                                          ver = job_info['ver'])
             # Log the job start
             self.model.LogJobStart(job_id)
-            # Create the appropriate build object
-            srcob = self.get_builder(job_info['srcURI'], job_info['id'])
 
             # Create the build script
             sbpath = srcob.makeSlackBuild(
                 result = 'Success'
 
             # Install the package if it was requested
-            if result == 'Success' and job_info['install'] == 1:
+            if result == 'Success' and job_info['install'] == "1":
                 self.print_to_log(
                     "\n   + Installing package per user request +")
                 proc = srcob.install_pkg()

src/vpackager/buildutils.py

     def install_pkg(self):
         fullpath = glob.glob(os.path.join(
             self.__myhome, self.ver,'%s-%s-*.t?z'% (
-                self.app, self.ger)))[0]
+                self.app, self.ver)))[0]
         if not fullpath:
             raise PackageNotFoundError
 

src/vpackager/dbutils.py

         form of a dictionary"""
         db,cursor = self._open()
         retval = {}
-        t = (str(job_id),)
+        t = (job_id,)
         cursor.execute('select * from queue where id=?',t)
         try:
             ret = cursor.next()
             retval['install'] = ret[7]
             retval['patches'] = ret[8]
         else:
-            retval = {}
+            retval = None
         self.close()
 
         return retval

src/vpackager/guitools.py

         mod.append(['Source URI', info['srcURI']])
         mod.append(['Description URI', info['descURI']])
         mod.append(['Source Type', info['type']])
-        mod.append(['Install After Build', info['install']==1])
+        mod.append(['Install After Build', info['install']=="1"])
         if patchlist:
             mod.append(['Patches to be applied', patchlist[0]])
             for x in range(1, len(patchlist)):
-                mod.apend(['',patchlist[x]])
+                mod.append(['',patchlist[x]])
         else:
             mod.append(['Patches to be applied', 'None'])
 

src/vpackager/viewcontrollers.py

         dia.hide()
 
         if res == gtk.RESPONSE_OK:
-            return self.model.NewJob(
+            ret = self.model.NewJob(
                 app = dia.app,
                 ver = dia.ver,
                 srcURI = dia.SrcURI,
                 install = dia.install,
                 patches = ','.join(dia.patches))
         else:
-            dia.destroy()
-            return None
+            ret = dia.destroy
+        return ret
+
 
 
 class HistoryController(QueueController):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.