mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Revert "Add missing async keywords in SQLiteSession"
This reverts commit 0f5eeb29e7
.
This commit is contained in:
parent
7d21b40401
commit
e87e6738b5
|
@ -303,11 +303,11 @@ class SQLiteSession(MemorySession):
|
|||
finally:
|
||||
c.close()
|
||||
|
||||
async def get_entity_rows_by_phone(self, phone):
|
||||
def get_entity_rows_by_phone(self, phone):
|
||||
return self._execute(
|
||||
'select id, hash from entities where phone = ?', phone)
|
||||
|
||||
async def get_entity_rows_by_username(self, username):
|
||||
def get_entity_rows_by_username(self, username):
|
||||
c = self._cursor()
|
||||
try:
|
||||
results = c.execute(
|
||||
|
@ -328,7 +328,7 @@ class SQLiteSession(MemorySession):
|
|||
finally:
|
||||
c.close()
|
||||
|
||||
async def get_entity_rows_by_name(self, name):
|
||||
def get_entity_rows_by_name(self, name):
|
||||
return self._execute(
|
||||
'select id, hash from entities where name = ?', name)
|
||||
|
||||
|
@ -346,7 +346,7 @@ class SQLiteSession(MemorySession):
|
|||
|
||||
# File processing
|
||||
|
||||
async def get_file(self, md5_digest, file_size, cls):
|
||||
def get_file(self, md5_digest, file_size, cls):
|
||||
row = self._execute(
|
||||
'select id, hash from sent_files '
|
||||
'where md5_digest = ? and file_size = ? and type = ?',
|
||||
|
@ -356,7 +356,7 @@ class SQLiteSession(MemorySession):
|
|||
# Both allowed classes have (id, access_hash) as parameters
|
||||
return cls(row[0], row[1])
|
||||
|
||||
async def cache_file(self, md5_digest, file_size, instance):
|
||||
def cache_file(self, md5_digest, file_size, instance):
|
||||
if not isinstance(instance, (InputDocument, InputPhoto)):
|
||||
raise TypeError('Cannot cache %s instance' % type(instance))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user