[Apt-offline-devel] [SCM] Offline APT Package Manager branch, apt-offline-qt, updated. v0.9.9-110-gdeef88f

Manish Sinha manishsinha.tech at gmail.com
Sat Aug 21 15:40:05 UTC 2010


The following commit has been merged in the apt-offline-qt branch:
commit bb4ade3839a19973dd7594c83476abe0e9aac821
Merge: 3149e518d8a1fe54c4c41129b2473a96b177150b aaa12657827ca58aee6b1e2edf5e964245990eb8
Author: Manish Sinha <manishsinha.tech at gmail.com>
Date:   Sat Jul 17 23:25:43 2010 +0530

    Merge branch 'master' of github.com:ideamonk/apt-offline
    
    Conflicts:
    	apt_offline_gui/Ui_AptOfflineQtInstall.py

diff --combined apt_offline_core/AptOfflineCoreLib.py
index d914fb3,6955d73..6148e52
--- a/apt_offline_core/AptOfflineCoreLib.py
+++ b/apt_offline_core/AptOfflineCoreLib.py
@@@ -52,7 -52,9 +52,9 @@@ except ImportError
  
  import AptOfflineMagicLib
  
+ #INFO: added to store progressbar info
  guiBool = False
+ totalSize = [0,0]             # total_size, current_total
  
  #INFO: Check if python-apt is installed
  PythonApt = True
@@@ -64,7 -66,6 +66,7 @@@ except ImportError
  PythonApt = False #Remove it after porting to python-apt
      
  import AptOfflineLib
 +import apt_offline_gui.QtProgressBar
  
  #INFO: Set the default timeout to 30 seconds for the packages that are being downloaded.
  socket.setdefaulttimeout(30)
@@@ -255,7 -256,11 +257,11 @@@ class GenericDownloadFunction()
                                  i += block_size
                                  counter += 1
                                  self.updateValue(increment)
+                                 #REAL_PROGRESS: update current total in totalSize
+                                 totalSize[1] += block_size
+                                 
                          self.completed()
+                         
                          data.close()
                          temp.close()
                          return True
@@@ -292,14 -297,7 +298,14 @@@ class DownloadFromWeb(AptOfflineLib.Pro
                  '''width = Progress Bar width'''
                  AptOfflineLib.ProgressBar.__init__(self, width=width, total_items=total_items)
          
 +class QtDownloadFromWeb(apt_offline_gui.QtProgressBar.QtProgressBar, GenericDownloadFunction):
 +        '''Class for DownloadFromWeb
 +        This class also inherits progressbar functionalities from
 +        parent class, ProgressBar'''
          
 +        def __init__(self,progressbar,label, total_items):
 +                '''width = Progress Bar width'''
 +                apt_offline_gui.QtProgressBar.QtProgressBar.__init__(self,progressbar=progressbar,label=label, total_items=total_items)
  
  
  def stripper(item):
@@@ -461,14 -459,6 +467,14 @@@ def fetcher( args )
                          AptOfflineLib.Archiver.__init__( self, lock=lock )
                          #self.lock = lock
          
 +        class QtFetcherClass( QtDownloadFromWeb, AptOfflineLib.Archiver, AptOfflineLib.Checksum ):
 +            def __init__( self, progress_bar, progress_label ,lock, total_items ):
 +                        QtDownloadFromWeb.__init__( self, progressbar=progress_bar, label=progress_label, total_items=total_items )
 +                        #ProgressBar.__init__(self, width)
 +                        #self.width = width
 +                        AptOfflineLib.Archiver.__init__( self, lock=lock )
 +                        #self.lock = lock
 +        
          if Str_DownloadDir is None:
                  tempdir = tempfile.gettempdir()
                  if os.access( tempdir, os.W_OK ) is True:
@@@ -535,14 -525,7 +541,14 @@@
          total_items = len(FetchData['Item'])
          
          #global FetcherInstance
 -        FetcherInstance = FetcherClass( width=30, lock=True, total_items=total_items )
 +        try:
 +            gui = args.qt_gui
 +            progress = args.progress_bar
 +            progressLabel = args.progress_label
 +            FetcherInstance = QtFetcherClass(progress=progress, progressLabel=progressLabel, lock=True, total_items=total_items )
 +        except AttributeError:
 +            FetcherInstance = FetcherClass( width=30, lock=True, total_items=total_items )
 +        
          
          #INFO: Thread Support
          if Int_NumOfThreads > 2:
@@@ -777,6 -760,23 +783,23 @@@
          # Start the threads.
          for t in thread_pool: t.start()
          
+         #REAL_PROGRESS: to calculate the total download size, NOTE: initially this was under the loop that Queued the items
+         if guiBool:
+             for key in FetchData.keys():
+                 for item in FetchData.get(key):
+                     try:
+                         (url, file, download_size, checksum) = stripper(item)
+                         size = int(download_size)
+                         if size == 0:
+                             log.msg("MSG_START")
+                             temp = urllib2.urlopen(url)
+                             headers = temp.info()
+                             size = int(headers['Content-Length'])
+                         totalSize[0] += size
+                     except:
+                         ''' some int parsing problem '''
+             log.msg("MSG_END")
+                 
          # Queue up the requests.
          #for item in raw_data_list: requestQueue.put(item)
          for key in FetchData.keys():
diff --combined apt_offline_gui/Ui_AptOfflineQtInstall.py
index e939bb8,cb135f7..8fd45ef
--- a/apt_offline_gui/Ui_AptOfflineQtInstall.py
+++ b/apt_offline_gui/Ui_AptOfflineQtInstall.py
@@@ -2,8 -2,8 +2,8 @@@
  
  # Form implementation generated from reading ui file 'AptOfflineQtInstall.ui'
  #
- # Created: Sun Feb 14 02:12:06 2010
- #      by: PyQt4 UI code generator 4.4.4
+ # Created: Sun Mar  7 03:28:04 2010
+ #      by: PyQt4 UI code generator 4.6
  #
  # WARNING! All changes made in this file will be lost!
  
@@@ -12,51 -12,58 +12,58 @@@ from PyQt4 import QtCore, QtGu
  class Ui_AptOfflineQtInstall(object):
      def setupUi(self, AptOfflineQtInstall):
          AptOfflineQtInstall.setObjectName("AptOfflineQtInstall")
-         AptOfflineQtInstall.setWindowModality(QtCore.Qt.WindowModal)
-         AptOfflineQtInstall.resize(466, 463)
+         AptOfflineQtInstall.setWindowModality(QtCore.Qt.ApplicationModal)
+         AptOfflineQtInstall.resize(466, 440)
+         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
+         sizePolicy.setHorizontalStretch(0)
+         sizePolicy.setVerticalStretch(0)
+         sizePolicy.setHeightForWidth(AptOfflineQtInstall.sizePolicy().hasHeightForWidth())
+         AptOfflineQtInstall.setSizePolicy(sizePolicy)
+         AptOfflineQtInstall.setMinimumSize(QtCore.QSize(466, 440))
+         AptOfflineQtInstall.setMaximumSize(QtCore.QSize(466, 440))
          self.zipFilePath = QtGui.QLineEdit(AptOfflineQtInstall)
-         self.zipFilePath.setGeometry(QtCore.QRect(30, 60, 270, 30))
+         self.zipFilePath.setGeometry(QtCore.QRect(30, 43, 270, 30))
          self.zipFilePath.setObjectName("zipFilePath")
          self.browseFilePathButton = QtGui.QPushButton(AptOfflineQtInstall)
-         self.browseFilePathButton.setGeometry(QtCore.QRect(320, 60, 110, 30))
+         self.browseFilePathButton.setGeometry(QtCore.QRect(320, 43, 110, 30))
          self.browseFilePathButton.setObjectName("browseFilePathButton")
          self.startInstallButton = QtGui.QPushButton(AptOfflineQtInstall)
          self.startInstallButton.setEnabled(False)
-         self.startInstallButton.setGeometry(QtCore.QRect(90, 110, 130, 30))
+         self.startInstallButton.setGeometry(QtCore.QRect(90, 93, 130, 30))
          icon = QtGui.QIcon()
          icon.addPixmap(QtGui.QPixmap(":/icons/icons/dialog-ok-apply.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
          self.startInstallButton.setIcon(icon)
          self.startInstallButton.setObjectName("startInstallButton")
          self.cancelButton = QtGui.QPushButton(AptOfflineQtInstall)
-         self.cancelButton.setGeometry(QtCore.QRect(240, 110, 140, 30))
+         self.cancelButton.setGeometry(QtCore.QRect(240, 93, 140, 30))
          icon1 = QtGui.QIcon()
          icon1.addPixmap(QtGui.QPixmap(":/icons/icons/dialog-cancel.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
          self.cancelButton.setIcon(icon1)
          self.cancelButton.setObjectName("cancelButton")
          self.statusProgressBar = QtGui.QProgressBar(AptOfflineQtInstall)
-         self.statusProgressBar.setGeometry(QtCore.QRect(30, 190, 410, 20))
+         self.statusProgressBar.setGeometry(QtCore.QRect(30, 161, 410, 20))
 -        self.statusProgressBar.setProperty("value", 0)
 +        self.statusProgressBar.setProperty("value", QtCore.QVariant(0))
          self.statusProgressBar.setObjectName("statusProgressBar")
          self.label = QtGui.QLabel(AptOfflineQtInstall)
-         self.label.setGeometry(QtCore.QRect(30, 30, 200, 30))
+         self.label.setGeometry(QtCore.QRect(30, 13, 200, 30))
          font = QtGui.QFont()
          font.setPointSize(10)
          self.label.setFont(font)
          self.label.setObjectName("label")
          self.label_2 = QtGui.QLabel(AptOfflineQtInstall)
-         self.label_2.setGeometry(QtCore.QRect(40, 170, 70, 16))
+         self.label_2.setGeometry(QtCore.QRect(40, 141, 70, 16))
          font = QtGui.QFont()
          font.setPointSize(10)
          self.label_2.setFont(font)
          self.label_2.setObjectName("label_2")
          self.progressStatusDescription = QtGui.QLabel(AptOfflineQtInstall)
-         self.progressStatusDescription.setGeometry(QtCore.QRect(90, 170, 53, 15))
+         self.progressStatusDescription.setGeometry(QtCore.QRect(90, 141, 53, 15))
          font = QtGui.QFont()
          font.setPointSize(10)
          self.progressStatusDescription.setFont(font)
          self.progressStatusDescription.setObjectName("progressStatusDescription")
          self.rawLogHolder = QtGui.QTextEdit(AptOfflineQtInstall)
-         self.rawLogHolder.setGeometry(QtCore.QRect(30, 230, 411, 221))
+         self.rawLogHolder.setGeometry(QtCore.QRect(30, 201, 411, 221))
          self.rawLogHolder.setObjectName("rawLogHolder")
  
          self.retranslateUi(AptOfflineQtInstall)
diff --combined apt_offline_gui/Ui_AptOfflineQtInstall.py.orig
index e939bb8,cb135f7..0c7211c
--- a/apt_offline_gui/Ui_AptOfflineQtInstall.py.orig
+++ b/apt_offline_gui/Ui_AptOfflineQtInstall.py.orig
@@@ -2,8 -2,8 +2,13 @@@
  
  # Form implementation generated from reading ui file 'AptOfflineQtInstall.ui'
  #
++<<<<<<< HEAD
 +# Created: Sun Feb 14 02:12:06 2010
 +#      by: PyQt4 UI code generator 4.4.4
++=======
+ # Created: Sun Mar  7 03:28:04 2010
+ #      by: PyQt4 UI code generator 4.6
++>>>>>>> aaa12657827ca58aee6b1e2edf5e964245990eb8
  #
  # WARNING! All changes made in this file will be lost!
  
@@@ -12,51 -12,58 +17,63 @@@ from PyQt4 import QtCore, QtGu
  class Ui_AptOfflineQtInstall(object):
      def setupUi(self, AptOfflineQtInstall):
          AptOfflineQtInstall.setObjectName("AptOfflineQtInstall")
-         AptOfflineQtInstall.setWindowModality(QtCore.Qt.WindowModal)
-         AptOfflineQtInstall.resize(466, 463)
+         AptOfflineQtInstall.setWindowModality(QtCore.Qt.ApplicationModal)
+         AptOfflineQtInstall.resize(466, 440)
+         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
+         sizePolicy.setHorizontalStretch(0)
+         sizePolicy.setVerticalStretch(0)
+         sizePolicy.setHeightForWidth(AptOfflineQtInstall.sizePolicy().hasHeightForWidth())
+         AptOfflineQtInstall.setSizePolicy(sizePolicy)
+         AptOfflineQtInstall.setMinimumSize(QtCore.QSize(466, 440))
+         AptOfflineQtInstall.setMaximumSize(QtCore.QSize(466, 440))
          self.zipFilePath = QtGui.QLineEdit(AptOfflineQtInstall)
-         self.zipFilePath.setGeometry(QtCore.QRect(30, 60, 270, 30))
+         self.zipFilePath.setGeometry(QtCore.QRect(30, 43, 270, 30))
          self.zipFilePath.setObjectName("zipFilePath")
          self.browseFilePathButton = QtGui.QPushButton(AptOfflineQtInstall)
-         self.browseFilePathButton.setGeometry(QtCore.QRect(320, 60, 110, 30))
+         self.browseFilePathButton.setGeometry(QtCore.QRect(320, 43, 110, 30))
          self.browseFilePathButton.setObjectName("browseFilePathButton")
          self.startInstallButton = QtGui.QPushButton(AptOfflineQtInstall)
          self.startInstallButton.setEnabled(False)
-         self.startInstallButton.setGeometry(QtCore.QRect(90, 110, 130, 30))
+         self.startInstallButton.setGeometry(QtCore.QRect(90, 93, 130, 30))
          icon = QtGui.QIcon()
          icon.addPixmap(QtGui.QPixmap(":/icons/icons/dialog-ok-apply.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
          self.startInstallButton.setIcon(icon)
          self.startInstallButton.setObjectName("startInstallButton")
          self.cancelButton = QtGui.QPushButton(AptOfflineQtInstall)
-         self.cancelButton.setGeometry(QtCore.QRect(240, 110, 140, 30))
+         self.cancelButton.setGeometry(QtCore.QRect(240, 93, 140, 30))
          icon1 = QtGui.QIcon()
          icon1.addPixmap(QtGui.QPixmap(":/icons/icons/dialog-cancel.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
          self.cancelButton.setIcon(icon1)
          self.cancelButton.setObjectName("cancelButton")
          self.statusProgressBar = QtGui.QProgressBar(AptOfflineQtInstall)
++<<<<<<< HEAD
 +        self.statusProgressBar.setGeometry(QtCore.QRect(30, 190, 410, 20))
 +        self.statusProgressBar.setProperty("value", QtCore.QVariant(0))
++=======
+         self.statusProgressBar.setGeometry(QtCore.QRect(30, 161, 410, 20))
+         self.statusProgressBar.setProperty("value", 0)
++>>>>>>> aaa12657827ca58aee6b1e2edf5e964245990eb8
          self.statusProgressBar.setObjectName("statusProgressBar")
          self.label = QtGui.QLabel(AptOfflineQtInstall)
-         self.label.setGeometry(QtCore.QRect(30, 30, 200, 30))
+         self.label.setGeometry(QtCore.QRect(30, 13, 200, 30))
          font = QtGui.QFont()
          font.setPointSize(10)
          self.label.setFont(font)
          self.label.setObjectName("label")
          self.label_2 = QtGui.QLabel(AptOfflineQtInstall)
-         self.label_2.setGeometry(QtCore.QRect(40, 170, 70, 16))
+         self.label_2.setGeometry(QtCore.QRect(40, 141, 70, 16))
          font = QtGui.QFont()
          font.setPointSize(10)
          self.label_2.setFont(font)
          self.label_2.setObjectName("label_2")
          self.progressStatusDescription = QtGui.QLabel(AptOfflineQtInstall)
-         self.progressStatusDescription.setGeometry(QtCore.QRect(90, 170, 53, 15))
+         self.progressStatusDescription.setGeometry(QtCore.QRect(90, 141, 53, 15))
          font = QtGui.QFont()
          font.setPointSize(10)
          self.progressStatusDescription.setFont(font)
          self.progressStatusDescription.setObjectName("progressStatusDescription")
          self.rawLogHolder = QtGui.QTextEdit(AptOfflineQtInstall)
-         self.rawLogHolder.setGeometry(QtCore.QRect(30, 230, 411, 221))
+         self.rawLogHolder.setGeometry(QtCore.QRect(30, 201, 411, 221))
          self.rawLogHolder.setObjectName("rawLogHolder")
  
          self.retranslateUi(AptOfflineQtInstall)

-- 
Offline APT Package Manager



More information about the Apt-offline-devel mailing list