コード例 #1
0
    def newFiles(self, out, binary):
        if binary:
           	file = 'Packages.gz'
        else:
            file = 'Sources.gz'
        filename = out + os.sep + file
        try:
            print 'Abriendo archivo %s'%filename
		    #new_fd = open(filename, "wb")
            print 
            #shutil.copyfile(filename,"%s.old"%filename)
            new_fd = gzip.open(filename, "wb")
        except:
            print "Error abriendo archivo de indices (Packages o Sources)"
            sys.exit(10)
        if binary:
            control_fields = ['Package', 'Source', 'Version', 'Section','Priority', 'Architecture', 'Maintainer','Pre-Depends',
                          'Depends', 'Suggests', 'Breaks','Recommends', 'Enhances', 'enhances', 'Conflicts', 'Provides','Replaces',
                           'Esential', 'Filename', 'Size', 'Installed-Size', 'MD5sum', 'Description', 'Uploaders', 'Bugs', 'Origin', 'Task', '']
        else:
            control_fields = ['Package', 'Binary', 'Version', 'Priority', 'Section', 'Maintainer', 'Build-Depends',
                              'Build-Depends-Indep', 'Build-Conflicts', 'Build-Conflicts-Indep', 'Architecture',
                                'Standards-Version', 'Format', 'Directory', 'Files', 'Uploaders', 'Bugs', 'Origin', 'Task', '']
        for package in self.pkg_list:
            for k in control_fields:
                if package.hasKey(k):
                    new_fd.write("%s: %s\n"%(k, package.get(k)))
            new_fd.write('\n')
        new_fd.close()
																																																																								   
        self.gen_compressed(filename, binary)
        try:
            os.remove(filename + ".old")
        except:
            pass
コード例 #2
0
 def removePackage(self,package):
     if self.searchPackage(package):
         self.pkg_list.remove(package)
         print "Package %s removed from the repo"%package.get('Package')
     else:
         print "El paquete no se encuentra en el repositorio"
コード例 #3
0
ファイル: resource.py プロジェクト: woshisx/unreal
def img_dir():
    resource_dir = package.get("liberResource")
    _dir = "%s/%s" % (resource_dir, "img")
    return _dir
コード例 #4
0
ファイル: resource.py プロジェクト: woshisx/unreal
def icon_file(icon_name):
    resource_dir = package.get("liberIcon")
    _file = "%s/%s" % (resource_dir, icon_name)
    if os.path.isfile(_file):
        return _file
    return ""
コード例 #5
0
ファイル: resource.py プロジェクト: woshisx/unreal
def qss(file_name="style.css"):
    resource_dir = package.get("liberResource")
    qss_file = "%s/qss/%s" % (resource_dir, file_name)
    return qss_file