~ubuntu-branches/ubuntu/feisty/aptoncd/feisty

« back to all changes in this revision

Viewing changes to metaPackage.py

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Proença
  • Date: 2007-03-13 17:29:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313172935-o9bsldf7qbau69o0
Tags: 0.1~rc-0ubuntu1
* Improvements in performance of the create treeview (+60% faster while mounting the list of packages);
* Added a call method for Download Repository (--download, just like --create) calling frmDownload without shown frmMainWindow;
* Now shows the number of downloaded files/to download in the Download Repository window;
* Placed a window when download susessful finished, asking if user want do remove the temp files;
* Improved the auto-select dependencies recursively, it's smarter now;
* locking unsuported characters to aptoncd iso fileaname;
* Hidding Cancel button while reading packages (we doesn't need this anymore, sice it's a faster process);
* Hidding the main window when using parameters (such --download, -i, --restore, etc);
* Moving the way APTonCD handle the destination of .iso images - Closes LP#89320;
* Do not close the window when user hasn't enought right in the destination folder - Closes LP#89325;
* Avoiding the user to select a destination folder that doesn't have writting permissions;
* Do not permit the user to restore an aptoncd media created in a version that differs from your running system;
* Correcting some grammar mistakes, applying Bruce's patch. Closes LP#89733;
* Now old packages in the Create list has a different pango markup to differ from the new ones;
* Changing the window type of frmCreate and frmRestore to show minimize and maximize buttons;
* Fixed bug while cancel the creation of APTonCD copy/iso
* Auto-select dependencies in create actived by default;
* Now we have a README.diskdefines inside the media, to make APT happy;
* Documentation update

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
packageErrorList = []
43
43
 
 
44
grayline = "<span foreground='gray'><b>%s</b>\n<small>%s</small></span>"
 
45
greenline = "<span foreground='#b84'><b>%s</b>\n<small>%s</small></span>"
44
46
def get_ErrorCount():
45
47
        return len(packageErrorList)
46
48
 
55
57
                tmp.loadPkg(fileName,path)
56
58
                if tmp.get_bad_package():
57
59
                        packageErrorList.append(tmp)
58
 
                        il = ([True, "<span foreground='gray'><b>%s</b>\n<small>%s</small></span>" % (tmp.get_pkg_Name() , (msg.MESSAGE_0046 % tmp.get_pkg_Version() + ' - ' + msg.MESSAGE_0047 % tmp.get_pkg_SizeText())) ,isCustom,tmp,True,True])
 
60
                        il = ([True, grayline % (tmp.get_pkg_Name() , (msg.MESSAGE_0046 % tmp.get_pkg_Version() + ' - ' + msg.MESSAGE_0047 % tmp.get_pkg_SizeText())) ,isCustom,tmp,True,True])
59
61
                else:
60
62
                        il = ([True, "<b>%s</b>\n<small>%s</small>" % (tmp.get_pkg_Name() , (msg.MESSAGE_0046 % tmp.get_pkg_Version() + ' - ' + msg.MESSAGE_0047 % tmp.get_pkg_SizeText())) ,isCustom,tmp,True,False])
61
63
 
62
64
 
63
65
                return il
 
66
 
 
67
def get_pkg_by_Name(packageList,iterText):
 
68
                itemFound = None
 
69
                
 
70
                e = 0
 
71
                d = len(packageList) - 1
 
72
                while e <= d:
 
73
                        m = (e + d) / 2
 
74
                        if packageList[m][config.C_PKG].get_pkg_Name() == iterText:
 
75
                                itemFound = packageList[m]
 
76
                                break
 
77
                        if packageList[m][config.C_PKG].get_pkg_Name() < iterText: e = m + 1
 
78
                        else: d = m - 1
 
79
                
 
80
                return itemFound
 
81
        
 
82
"""
64
83
def get_pkg_by_Name(packageList,iterText):
65
84
                itemFound = None
66
85
                for iter in packageList:
70
89
                                break
71
90
                        
72
91
                return itemFound
73
 
                
 
92
"""
 
93
"""             
74
94
def itemExistSearch(packageList,iterText,strPath = ""):
75
95
                itemFound = False;
76
96
                a = packageFile()
86
106
                                break
87
107
 
88
108
                return itemFound        
89
 
 
 
109
"""
 
110
def itemExistSearch(packageList,iterText,strPath = ""):
 
111
        itemFound = False;
 
112
        a = packageFile()
 
113
        if strPath != "":
 
114
                        a.loadPkg(os.path.join(strPath,iterText))
 
115
        else:
 
116
                        a.loadPkg(iterText)
 
117
                
 
118
        e = 0
 
119
        d = len(packageList) - 1
 
120
        while e <= d:
 
121
                m = (e + d) / 2
 
122
                if packageList[m][config.C_PKG].get_pkg_FileName() == a.get_pkg_FileName():
 
123
                        itemFound = True
 
124
                        break
 
125
                if packageList[m][config.C_PKG].get_pkg_FileName() < a.get_pkg_FileName(): e = m + 1
 
126
                else: d = m - 1
 
127
        return itemFound        
90
128
#def addNewListItem(packageList,iList, iSelect = False):
91
129
#               iter = packageList.append(iList)
92
130
#               if iSelect:
130
168
                for e in packageList:
131
169
                        item = e[config.C_PKG]
132
170
                        e[config.C_CHECKED] = isMajorVersion(tmp,item)
 
171
                        if not e[config.C_CHECKED]:
 
172
                                e[config.C_TITLE]= greenline % (item.get_pkg_Name() , (msg.MESSAGE_0046 % item.get_pkg_Version() + ' - ' + msg.MESSAGE_0047 % item.get_pkg_SizeText()))
133
173
                        if not e[config.C_DISABLED]:
134
174
                                e[config.C_CANCHECK] = e[config.C_CHECKED]      
135
175
 
136
176
def checkDepends(packageList,dependent):
137
177
        tmp = packageList
138
 
        for dep in dependent:
139
 
                item = get_pkg_by_Name(packageList,dep)
140
 
                if item != None:
141
 
                        item[config.C_CHECKED] = isMajorVersion(tmp,item[config.C_PKG])
 
178
        newdependents = []
 
179
        newdependents.append(dependent)
 
180
 
 
181
        for dependent in newdependents:
 
182
                for dep in dependent:
 
183
                        item = get_pkg_by_Name(packageList,dep)
 
184
                        if item != None and not item[config.C_CHECKED]:
 
185
                                item[config.C_CHECKED] = isMajorVersion(tmp,item[config.C_PKG])
 
186
                                if not item[config.C_PKG].depends in newdependents:
 
187
                                        newdependents.append(item[config.C_PKG].depends)
 
188
                         
142
189
                
143
190
def countChecked(packageList):
144
191