def main(): #main function ''' main function of ZCR Shellcoder ''' if argv_control.exist() is not True: #if execute without any argv start.start() #show start page and exit else: if argv_control.check() is True: #check argv, if entered accurately analyser.do(argv_control.run()) #go for generating start.sig() #print software signature and exit else: start.inputcheck()
def run(self): """ Run task """ # set django env to load django settings.py and get database config # os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings") # from django.core import management # append web module ti python path sys.path.append(os.path.join(self.core.settings.root, 'src', 'web')) from web.taskqueue.models_peewee import TaskPeewee as Task print("start working on task %s" % self.task_id) task = Task.get(Task.id == self.task_id) if task.status != Task.STATUS_PENDING: raise Exception("Incorrect status: " + task.status) # create core with settings for current task settings = None if task.settings: settings = json.loads(task.settings) start(settings) # configure logger logger = logging.getLogger() # remove all handlers logger.handlers = [] # all to output, tornado will write to db from output of this process ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s [%(levelname)s] %(module)s.%(funcName)s: %(message)s') logger.addHandler(ch) ch.setLevel(logging.INFO) logger.addHandler(ch) self.do_task(task, Task.LOCK) sys.exit(0)
def main(): ''' main function of ZCR Shellcoder ''' if argv_control.exist() is not True: process = start.start() sys.exit(0) if argv_control.exist() is True: process_check = False if argv_control.check() is True: process_check = True analyser.do(argv_control.run()) start.sig() if process_check is False: start.inputcheck()
def setUpClass(cls): Core._instance = None cls.core = start.start(dict(os='windows', bitness='64', urls=['../ZooFeed/']))
def main(): start() updater() main_menu()