dbrtools/dbr/dbrutils.py
changeset 201 4e09c8ccae86
parent 200 12422144aae1
child 203 e274d29c8bc9
equal deleted inserted replaced
200:12422144aae1 201:4e09c8ccae86
    72         
    72         
    73     
    73     
    74 def extractfromzip(files, name, location):
    74 def extractfromzip(files, name, location):
    75     tmpfilename = os.tmpnam( )
    75     tmpfilename = os.tmpnam( )
    76     print tmpfilename
    76     print tmpfilename
       
    77     cwd = os.getcwd();
    77     os.chdir(os.path.join(epocroot(),location))
    78     os.chdir(os.path.join(epocroot(),location))
    78     f = open(tmpfilename,'w')
    79     f = open(tmpfilename,'w')
    79     for file in sorted(files):
    80     for file in sorted(files):
    80         str = '%s%s' % (file,'\n')
    81         str = '%s%s' % (file,'\n')
    81         f.write(str)    
    82         f.write(str)    
    83     exestr = '7z x -y -i@%s %s >nul' %(tmpfilename,name)
    84     exestr = '7z x -y -i@%s %s >nul' %(tmpfilename,name)
    84 #    exestr = '7z x -y -i@%s %s' %(tmpfilename,name)
    85 #    exestr = '7z x -y -i@%s %s' %(tmpfilename,name)
    85     print 'executing: >%s<\n' %exestr
    86     print 'executing: >%s<\n' %exestr
    86     os.system(exestr)
    87     os.system(exestr)
    87     os.unlink(tmpfilename)
    88     os.unlink(tmpfilename)
       
    89     os.chdir(cwd)
    88 
    90 
    89 def deletefiles(files):
    91 def deletefiles(files):
    90     os.chdir(epocroot())
    92     os.chdir(epocroot())
    91     for file in files:
    93     for file in files:
    92       print 'deleting %s' %file
    94       print 'deleting %s' %file