Aug-27-2018, 07:21 PM
This is my first post so ... forgive any faux pas.
This seems straightforward, right? The name must be wrong:
The calling program: Note that the first line causes a problem. If that line is commented the second line succeeeds.
Aha! we say, must be a duplicate file somewhere in teh path where this class is defined as well ...
It seems not!
grep 'class DatabaseProcess'
grep 'a'
root@glaptop:/home/.../Database# grep 'class DatabaseProcess'
/home/gary/projects/Brix/Database/database_processes.py:class DatabaseProcess(object):
FINDS IT, that is where I expect it to be. The search starts very high in the directory tree, high enough to find it anywhere.
But this finds nothing in dist-packages (and I wuld not exepct it to becasue this is a dev box)
root@gary-laptop:/home/.../Database# grep 'class DatabaseProcess'
What am I missing? Thanks for helpting!
Error:AttributeError: 'DatabaseProcess' object has no attribute 'update_card_in_information_from_card_number'
Python3.6 asyncioThis seems straightforward, right? The name must be wrong:
The calling program: Note that the first line causes a problem. If that line is commented the second line succeeeds.
import asyncio import logging import json from Database.database import Database from Database.database_processes import DatabaseProcess ... self.dbprocess = DatabaseProcess(self.log, self.database) --- await self.dbprocess.update_card_in_information_from_card_number(request.requestor, request.card_number) request.card_record = await self.dbprocess.get_card_record_from_card_number(request.card_number)Here is the class(callee):
import asyncio import logging class DatabaseProcess(object): def __init__(self, log, database): self.database = database ... async def get_card_record_from_card_number(self, card_number): stmt = "select * from cards where card_number = '{}' and dt_inactivated is null".format(card_number) ... async def update_card_in_information_from_card_number(self, machine_id, card_number): exec_stmt = "update cards set dt_last_inserted = now(), last_machine_id = %s where card_number = %s" ...Here is where it goes bonkers: if I go to the file database_processes.py which contains the DatabaseProcess class and mangle the second name, the one that works, it keeps working.
Aha! we say, must be a duplicate file somewhere in teh path where this class is defined as well ...
It seems not!
grep 'class DatabaseProcess'
find / -name 'database*.py'
grep 'a'
find . -name 'database*.py'
root@glaptop:/home/.../Database# grep 'class DatabaseProcess'
find .../projects/ -name '*.py*'
/home/gary/projects/Brix/Database/database_processes.py:class DatabaseProcess(object):
FINDS IT, that is where I expect it to be. The search starts very high in the directory tree, high enough to find it anywhere.
But this finds nothing in dist-packages (and I wuld not exepct it to becasue this is a dev box)
root@gary-laptop:/home/.../Database# grep 'class DatabaseProcess'
find /usr/lib/python3/dist-packages/ -name '*.py*'
What am I missing? Thanks for helpting!