Ejemplo n.º 1
0
 def compress(self, cmd, suffix, path):
     in_filename = "{0}.new".format(path)
     out_filename = "{0}{1}.new".format(path, suffix)
     if cmd is not None:
         with open(in_filename, 'r') as in_fh, open(out_filename, 'w') as out_fh:
             check_call(cmd, stdin=in_fh, stdout=out_fh, close_fds=True)
     self.rename("{0}{1}".format(path, suffix))
Ejemplo n.º 2
0
 def compress(self, cmd, suffix, path):
     in_filename = "{0}.new".format(path)
     out_filename = "{0}{1}.new".format(path, suffix)
     if cmd is not None:
         with open(in_filename, 'r') as in_fh, open(out_filename, 'w') as out_fh:
             check_call(cmd, stdin=in_fh, stdout=out_fh, close_fds=True)
     self.rename("{0}{1}".format(path, suffix))
Ejemplo n.º 3
0
def save_icon(icon,ID,filepath):
    '''
    Extracts the icon from the deb package and stores it.
    '''
    try:
        check_call("dpkg --fsys-tarfile {0} | tar xOf - .{1} > {2}/{3}.png".format(filepath,icon,Config()["Dir::Icon"],ID),
                    shell=True,stdout=logfile,stderr=logfile)
        print "Saved icon...."
        return True
    except CalledProcessError:
        return False
Ejemplo n.º 4
0
 def compress(self, cmd, suffix, path):
     in_filename = "{0}.new".format(path)
     out_filename = "{0}.{1}.new".format(path, suffix)
     with open(in_filename, 'r') as in_fh, open(out_filename, 'w') as out_fh:
         check_call(cmd, stdin=in_fh, stdout=out_fh)
     self.rename("{0}.{1}".format(path, suffix))
Ejemplo n.º 5
0
 def compress(self, cmd, suffix, path):
     in_filename = "{0}.new".format(path)
     out_filename = "{0}.{1}.new".format(path, suffix)
     with open(in_filename, 'r') as in_fh, open(out_filename, 'w') as out_fh:
         check_call(cmd, stdin=in_fh, stdout=out_fh)
     self.rename("{0}.{1}".format(path, suffix))