def process(transaction): """Dropbox entry point. @param transaction, the transaction object """ # Get path to containing folder # __file__ does not work (reliably) in Jython dbPath = "../core-plugins/microscopy/4/dss/drop-boxes/MicroscopyDropbox" # Path to the logs subfolder logPath = os.path.join(dbPath, "logs") # Make sure the logs subfolder exist if not os.path.exists(logPath): os.makedirs(logPath) # Path for the log file logFile = os.path.join(logPath, "log.txt") # Set up logging logging.basicConfig(filename=logFile, level=logging.DEBUG, format='%(asctime)-15s %(levelname)s: %(message)s') logger = logging.getLogger("Microscopy") # Create a Processor processor = Processor(transaction, logger) # Run processor.run()
def process(transaction): """Dropbox entry point. @param transaction, the transaction object """ # Get path to containing folder # __file__ does not work (reliably) in Jython dbPath = "../core-plugins/microscopy/2/dss/drop-boxes/MicroscopyDropbox" # Path to the logs subfolder logPath = os.path.join(dbPath, "logs") # Make sure the logs subfolder exist if not os.path.exists(logPath): os.makedirs(logPath) # Path for the log file logFile = os.path.join(logPath, "log.txt") # Set up logging logging.basicConfig(filename=logFile, level=logging.DEBUG, format='%(asctime)-15s %(levelname)s: %(message)s') logger = logging.getLogger("Microscopy") # Create a Processor processor = Processor(transaction, logger) # Run processor.run()
def proc(self, config: dict, record_dir: str, danmu_path: str, current_state, state_change_time) -> None: p = Processor(config, record_dir, danmu_path) p.run() if config.get('spec', {}).get('uploader', {}).get('record', {}).get( 'upload_record', False) or config.get('spec', {}).get( 'uploader', {}).get('clips', {}).get( 'upload_clips', False): current_state.value = int(utils.state.UPLOADING_TO_BILIBILI) state_change_time.value = time.time() try: u = Uploader(p.outputs_dir, p.splits_dir, config) d = u.upload(p.global_start) except Exception as e: current_state.value = int(utils.state.ERROR) state_change_time.value = time.time() if d is None: current_state.value = int(utils.state.ERROR) state_change_time.value = time.time() else: if not config.get('spec', {}).get('uploader', {}).get( 'record', {}).get('keep_record_after_upload', True) and d.get( "record", None) is not None and not config.get('root', {}).get( 'uploader', {}).get('upload_by_edit', False): rc = BiliVideoChecker(d['record']['bvid'], p.splits_dir, config) rc.start() if not config.get('spec', {}).get('uploader', {}).get( 'clips', {}).get('keep_clips_after_upload', True) and d.get( "clips", None) is not None and not config.get('root', {}).get( 'uploader', {}).get('upload_by_edit', False): cc = BiliVideoChecker(d['clips']['bvid'], p.outputs_dir, config) cc.start() if config.get('root', {}).get('enable_baiduyun', False) and config.get( 'spec', {}).get('backup', False): current_state.value = int(utils.state.UPLOADING_TO_BAIDUYUN) state_change_time.value = time.time() try: from bypy import ByPy bp = ByPy() bp.upload(p.merged_file_path) except Exception as e: logging.error('Error when uploading to Baiduyun:' + str(e) + traceback.format_exc()) current_state.value = int(utils.state.ERROR) state_change_time.value = time.time() return if current_state.value != int(utils.state.LIVE_STARTED): current_state.value = int(utils.state.WAITING_FOR_LIVE_START) state_change_time.value = time.time()
def process(transaction): """Dropbox entry point. @param transaction, the transaction object """ # # Run registration # prefix = "MOFLO_XDP" version = 2 logDir = "../core-plugins/flow/4/dss/drop-boxes/BCMoFloXDPDropbox/logs" processor = Processor(transaction, prefix, version, logDir) processor.run()
def process(transaction): """Dropbox entry point. @param transaction, the transaction object """ # # Run registration # prefix = "INFLUX" version = 2 logDir = "../core-plugins/flow/3/dss/drop-boxes/BDInfluxDropbox/logs" processor = Processor(transaction, prefix, version, logDir) processor.run()
def process(transaction): """Dropbox entry point. @param transaction, the transaction object """ # # Run registration # prefix = "LSR_FORTESSA" version = 2 logDir = "../core-plugins/flow/4/dss/drop-boxes/BDLSRFortessaDropbox/logs" processor = Processor(transaction, prefix, version, logDir) processor.run()
def proc(config: dict, record_dir: str, danmu_path: str) -> None: p = Processor(config, record_dir, danmu_path) p.run() u = Uploader(p.outputs_dir, p.splits_dir, config) d = u.upload(p.global_start) if not config['spec']['uploader']['record'][ 'keep_record_after_upload'] and d.get("record", None) is not None: rc = BiliVideoChecker(d['record']['bvid'], p.splits_dir, config) rc_process = Process(target=rc.check) rc_process.start() if not config['spec']['uploader']['clips'][ 'keep_clips_after_upload'] and d.get("clips", None) is not None: cc = BiliVideoChecker(d['clips']['bvid'], p.outputs_dir, config) cc_process = Process(target=cc.check) cc_process.start() if config['root']['enable_baiduyun'] and config['spec']['backup']: from bypy import ByPy bp = ByPy() bp.upload(p.merged_file_path)
def proc(config: dict, record_dir: str, danmu_path: str) -> None: p = Processor(config, record_dir, danmu_path) p.run() u = Uploader(p.outputs_dir, p.splits_dir, config) u.upload(p.global_start)
from Processor import Processor, ProcessorEndOfProgramException with open('input_d9.txt') as f: common_code = f.readline().strip().split(',') # common_code = [109,1,204,-1,1001,100,1,100,1008,100,16,101,1006,101,0,99] # common_code = [str(x) for x in common_code] computer = Processor(common_code, 0) computer.reset() try: computer.run() computer.push_input(1) except ProcessorEndOfProgramException: print(computer.read_output())
def main(inhost,inport, outport, type): me = ProcessorWorkerFilter(type) c = Processor() c.run(inhost,inport,outport,me)
from Processor import Processor # Function for displaying continuous video strea # n: Camera number on computer (usually n=0 for built-in webcam) # Exit video by clicking into video and pressing ESC key if __name__ == '__main__': #co.stream(1) #change this to 1 to use the webcam #get user input for time, interv reaction_id = input("What is the reaction ID? ") time = int(float(input("How long would you like to analyze for (s)? "))) interv = int(float(input("How often do you want to check(s)? "))) #constructor p = Processor(time, interv, reaction_id) #this function runs all iterations of the processor class as defined by the tine and interval dropbox_dir = "/Users/shreyamenon/Dropbox" #dropbox directory p.run()
def main(inhost,inport, outport): me = ProcessorWorker() c = Processor() c.run(inhost,inport,outport,me)