Avoid more cyclic imports on the session file

This commit is contained in:
Lonami Exo 2018-01-08 12:14:03 +01:00
parent f4182376f1
commit 3c686fecdf

View File

@ -2,12 +2,13 @@ import json
import os import os
import platform import platform
import sqlite3 import sqlite3
import struct
import time import time
from base64 import b64decode from base64 import b64decode
from os.path import isfile as file_exists from os.path import isfile as file_exists
from threading import Lock from threading import Lock
from .. import utils, helpers from .. import utils
from ..tl import TLObject from ..tl import TLObject
from ..tl.types import ( from ..tl.types import (
PeerUser, PeerChat, PeerChannel, PeerUser, PeerChat, PeerChannel,
@ -62,7 +63,7 @@ class Session:
self.save_entities = True self.save_entities = True
self.flood_sleep_threshold = 60 self.flood_sleep_threshold = 60
self.id = helpers.generate_random_long(signed=True) self.id = struct.unpack('q', os.urandom(8))[0]
self._sequence = 0 self._sequence = 0
self.time_offset = 0 self.time_offset = 0
self._last_msg_id = 0 # Long self._last_msg_id = 0 # Long