def process_bind_param(self, value, dialect): if value is None: print( colorized_string(f"[[COUNTER-SET]] #RED#{str(value)}#RESET#")) return 0 else: print( colorized_string( f"[[COUNTER-SET]] #RED#{str(value+1)}#RESET#")) return value + 1
def process_result_value(self, value, dialect): if value is None: print( colorized_string( f"[[COUNTER-GET]] #YELLOW#{str(value)}#RESET#")) return 0 else: print( colorized_string( f"[[COUNTER-GET]] #YELLOW#{str(value+1)}#RESET#")) return value + 1
def process_result_value(self, value, dialect): if value is None: return value else: if dialect.name == 'sqlite': self.bobbi = self.bobbi + 1 print(self.bobbi, colorized_string(f"[UUID-GET] #RED#{str(value)}#RESET#")) return str(value) else: if not isinstance(value, uuid.UUID): value = uuid.UUID(value) return value
def process_bind_param(self, value, dialect): if value is None: return value elif dialect.name == 'sqlite': self.shalimar = self.shalimar + 1 print(self.shalimar, colorized_string(f"[UUID-SET] [[{str(value)}]]")) return str(value) elif dialect.name == 'postgresql': print('SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS') return str(value) elif dialect.name == 'mysql': print('SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS') return str(value) else: print('SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS') if not isinstance(value, uuid.UUID): return "%.32x" % uuid.UUID(value).int else: # hexstring return "%.32x" % value.int
if not configuration.get('apis'): configuration.update({'apis': {}}) for ix in range(0, len(dbapis)): api_name = dbapis[ix] if not configuration.get('apis', {}).get(api_name): api_entry = { dbapis[ix]: { 'status': 'Active', 'version': '1.1', 'debug_level': -1 } } configuration['apis'].update(api_entry) return configuration #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: msg = f'module [{module_id}] [[version {module_version}]] loaded.' if CONSOLE_ON: print(colorized_string(msg)) #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # main #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: if __name__ == '__main__': print(__file__)