コード例 #1
0
ファイル: scan.py プロジェクト: dmtaub/scantelope
   def setConfigFromNext(self):
       modDate= modification_date(customDir)
       if modDate != Config.configModified:
           print "Configuration modified, reloading..."
           self.acquire()
           Config.reloadConfig(Config.currentKey)
           self.release()

       self.acquire()
       if self.nextConfig != None:
           Config.setActive(self.nextConfig)
           self.nextConfig = None
       self.release()
コード例 #2
0
ファイル: scan.py プロジェクト: dmtaub/scantelope
   def __init__(self,event):
       threading.Thread.__init__(self)

       self.lock = threading.RLock()
       self.event = event
       
       self.forceRepeat = False
       self.getFilenames()
       self.dm = decode.DMDecoder(self.myDir,self.files)#,res = self.res)
       self.daemon = True #This kills this thread when the main thread stops  
       
       self.scanners = {} 
       self.scannerNames = {0:"none"}

       self.isScanning = False
       self.calibrating= False
       
       res = Config.reloadConfig()
       
       self.setNextRes(res)
       self.setResFromNext()
       
#      self.whichScanner = 0
       self.nextScanner = 0 #bypasses checks since scanners dict is empty
       self.setScannerFromNext()       
       self.nextConfig = None
      
       self.setDecoded({})
       self.mostRecentUpdate = datetime.now()      
       self.decodeOnly = False       

       self.setStatus(strtime()+'\ninitialized\n')