Avdump GUI: Difference between revisions

Jump to navigation Jump to search
268 bytes added ,  10 November 2007
No edit summary
(→‎Source: 1.04)
Line 31: Line 31:
class mainFrame(wx.Frame):
class mainFrame(wx.Frame):
     __simple = ['p','z','r','m','c','o','9']
     __simple = ['p','z','r','m','c','o','9']
     __options = {'avdump':'avdump.exe','user':'','pass':'','ext':'','misc':'','bsize':'2048','port':'','tout':'30','retries':'6','exp':'export.txt','log':'log.txt','done':'done.txt'}
     __options = {'avdump':'avdump.exe','user':'','pass':'','ext':'','misc':'','bsize':'2048:1','port':'','tout':'30','retries':'6','exp':'export.txt','log':'log.txt','done':'done.txt'}
     __configfile='config.ini'
     __configfile='config.ini'


Line 39: Line 39:
             for elem in self.__options:
             for elem in self.__options:
                 newconfig += ('%s=%s\n') %(elem,self.__options[elem])
                 newconfig += ('%s=%s\n') %(elem,self.__options[elem])
             open(self.__configfile,"w").write(newconfig)
             file(self.__configfile,"w").write(newconfig)
         for line in open(self.__configfile,"r").readlines():
         for line in file(self.__configfile,"r").readlines():
             if not line.endswith('='):
             if not line.endswith('='):
                 temp,val = line.rstrip('\n').split('=',1)
                 temp,val = line.rstrip('\n').split('=',1)
Line 79: Line 79:
         dialog.Destroy()
         dialog.Destroy()
         self.filepath.write(path)
         self.filepath.write(path)
         self.__options['scanpath'] = path
         self.__options['scanpath'] = path.encode("cp932")


     def startClick(self, event):
     def startClick(self, event):
Line 112: Line 112:
class OptionsFrame(wx.Frame):
class OptionsFrame(wx.Frame):
     __box = {'ext':False,'log':False,'exp':False,'port':False,'done':False,'bsize':False,'tout':False,'c':False,'m':False,'p':False,'r':False,'z':False,'o':False,'9':False}
     __box = {'ext':False,'log':False,'exp':False,'port':False,'done':False,'bsize':False,'tout':False,'c':False,'m':False,'p':False,'r':False,'z':False,'o':False,'9':False}
     __options = {'avdump':'avdump.exe','user':'','pass':'','ext':'','misc':'','bsize':'2048','port':'','tout':'30','retries':'6','exp':'export.txt','log':'log.txt','done':'done.txt'}
     __options = {'avdump':'avdump.exe','user':'','pass':'','ext':'','misc':'','bsize':'2048:1','port':'','tout':'30','retries':'6','exp':'export.txt','log':'log.txt','done':'done.txt'}
     __configfile='config.ini'
     __configfile='config.ini'


Line 119: Line 119:
         if not os.path.exists(self.__configfile):
         if not os.path.exists(self.__configfile):
             self.write_config()
             self.write_config()
         for line in open(self.__configfile,"r").readlines():
         for line in file(self.__configfile,"r").readlines():
             if not line.endswith('='):
             if not line.endswith('='):
                 temp,val = line.rstrip('\n').split('=',1)
                 temp,val = line.rstrip('\n').split('=',1)
Line 131: Line 131:
         for elem in self.__options:
         for elem in self.__options:
             newconfig += ('%s=%s\n') %(elem,self.__options[elem])
             newconfig += ('%s=%s\n') %(elem,self.__options[elem])
             open(self.__configfile,"w").write(newconfig)
             file(self.__configfile,"w").write(newconfig)


     def set_misc(self,misc=''):
     def set_misc(self,misc=''):
Line 290: Line 290:
         self.__options['pass'] = self.password.GetValue()
         self.__options['pass'] = self.password.GetValue()
         self.__options['ext'] = self.extention.GetValue()
         self.__options['ext'] = self.extention.GetValue()
         '''make sure it's mod 8 and at least 256kb'''
         try:
        try:
            temp,temp2 = self.buffersize.GetValue().split(":")
            temp = int(self.buffersize.GetValue())
            temp = int(temp)
             if int(temp) < 256:
            temp2 = int(temp2)
            '''make sure it's mod 8 and at least 256kb'''
             if temp < 256:
                 temp = 256
                 temp = 256
             if not temp % 8:
             if not temp % 8:
                 temp = temp - (temp%8)
                 temp = temp - (temp%8)
            '''make sure the buffernumber is between 1 and 8'''
            if temp2 > 8 or temp2 <1:
                temp2 = 1
            temp = ("%s:%s") %(temp, temp2)
         except:
         except:
             temp = 2048
             temp = "2048:1"
         self.__options['bsize'] = unicode(temp)
         self.__options['bsize'] = unicode(temp)
         try:
         try:

Navigation menu

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.