def run(self): sync = Sync(show_progress=self._isManual, run_silent=self._runSilent, library=self._library, api=globals.traktapi) sync.sync() if utilities.getSettingAsBool('tagging_enable') and utilities.getSettingAsBool('tagging_tag_after_sync'): q = queue.SqliteQueue() q.append({'action': 'updatetags'})
def run(self): sync = Sync(show_progress=self._isManual, run_silent=self._runSilent, api=globals.traktapi) sync.sync() if utilities.getSettingAsBool('tagging_enable') and utilities.getSettingAsBool('tagging_tag_after_sync'): q = queue.SqliteQueue() q.append({'action': 'updateTags'})
def op_sync (self): conf = self.get_config() pname = self._load_profile() sync = Sync(conf, pname, self.get_db(), dr=self.is_dry_run()) if self.is_dry_run(): sync.prep_lists(self.get_sync_dir()) else: try: startt = conf.get_curr_time() result = sync.sync(self.get_sync_dir()) if result: conf.set_last_sync_start(pname, val=startt) conf.set_last_sync_stop(pname) logging.info('Updating item inventory...') sync.save_item_lists() logging.info('Updating item inventory...done') else: logging.info('timestamps not reset for profile %s due to ' 'errors (previously identified).', pname) except Exception, e: logging.critical('Exception (%s) while syncing profile %s', str(e), pname) logging.critical(traceback.format_exc()) return False
def op_sync(self): conf = self.get_config() pname = self._load_profile() startt_old = conf.get_last_sync_start(pname) stopt_old = conf.get_last_sync_stop(pname) if self.is_sync_all(): # This is the case the user wants to force a sync ignoring the # earlier sync states. This is useful when ASynK code changes - # and let's say we add support for synching a enw field, or some # such. # # This works by briefly resetting the last sync start and stop # times to fool the system. If the user is doing a dry run, we # will restore his earlier times dutifully. if self.is_dry_run(): logging.debug('Temporarily resetting last sync times...') conf.set_last_sync_start(pname, val="1980-01-01T00:00:00.00+00:00") conf.set_last_sync_stop(pname, val="1980-01-01T00:00:00.00+00:00") sync = Sync(conf, pname, self.get_db(), dr=self.is_dry_run()) if self.is_dry_run(): sync.prep_lists(self.get_sync_dir()) # Since it is only a dry run, resetting to the timestamps to the # real older sync is sort of called for. conf.set_last_sync_start(pname, val=startt_old) conf.set_last_sync_stop(pname, val=stopt_old) logging.debug('Reset last sync timestamps to real values') else: try: startt = conf.get_curr_time() result = sync.sync(self.get_sync_dir()) if result: conf.set_last_sync_start(pname, val=startt) conf.set_last_sync_stop(pname) logging.info('Updating item inventory...') sync.save_item_lists() logging.info('Updating item inventory...done') else: logging.info( 'timestamps not reset for profile %s due to ' 'errors (previously identified).', pname) except Exception, e: logging.critical('Exception (%s) while syncing profile %s', str(e), pname) logging.critical(traceback.format_exc()) return False
def op_sync (self): conf = self.get_config() pname = self._load_profile() startt_old = conf.get_last_sync_start(pname) stopt_old = conf.get_last_sync_stop(pname) if self.is_sync_all(): # This is the case the user wants to force a sync ignoring the # earlier sync states. This is useful when ASynK code changes - # and let's say we add support for synching a enw field, or some # such. # # This works by briefly resetting the last sync start and stop # times to fool the system. If the user is doing a dry run, we # will restore his earlier times dutifully. if self.is_dry_run(): logging.debug('Temporarily resetting last sync times...') conf.set_last_sync_start(pname, val=utils.time_start) conf.set_last_sync_stop(pname, val=utils.time_start) sync = Sync(conf, pname, [x.get_db() for x in self.get_colls()], dr=self.is_dry_run()) if self.is_dry_run(): sync.prep_lists(self.get_sync_dir()) # Since it is only a dry run, resetting to the timestamps to the # real older sync is sort of called for. conf.set_last_sync_start(pname, val=startt_old) conf.set_last_sync_stop(pname, val=stopt_old) logging.debug('Reset last sync timestamps to real values') else: try: startt = conf.get_curr_time() result = sync.sync(self.get_sync_dir()) if result: conf.set_last_sync_start(pname, val=startt) conf.set_last_sync_stop(pname) logging.info('Updating item inventory...') sync.save_item_lists() logging.info('Updating item inventory...done') else: logging.info('timestamps not reset for profile %s due to ' 'errors (previously identified).', pname) except Exception, e: logging.critical('Exception (%s) while syncing profile %s', str(e), pname) logging.critical(traceback.format_exc()) return False
def run(self): sync = Sync(show_progress=self._isManual, run_silent=self._runSilent, library=self._library, api=globals.traktapi) sync.sync()
def run(self): sync = Sync(show_progress=self._isManual, api=globals.traktapi) sync.sync()
import json import sys from enko import EnkoAPI from isilist_api import IsilistAPI from repository import UserLists from sync import Sync from transformer import ISIEnkoTransformer if __name__ == "__main__": isilist_api = IsilistAPI() email, password = sys.argv[1], sys.argv[2] isilist_api.init(email, password) sync = Sync(isilist_api.get_sync()) sync.sync() user_lists = UserLists.extract_as_enko() user_lists = [ISIEnkoTransformer.transform(user_list) for user_list in user_lists] enko_api = EnkoAPI() enko_api.process_sales(user_lists, '2016-01-01')