Merge branch 'master' into docs

This commit is contained in:
Dan 2018-03-26 03:39:45 +02:00
commit d3b82ef622
2 changed files with 8 additions and 8 deletions

View File

@ -18,17 +18,18 @@
import logging import logging
import socket import socket
import sys
from collections import namedtuple from collections import namedtuple
try: try:
import socks import socks
except ImportError: except ImportError as e:
sys.exit( e.msg = (
"PySocks is missing and Pyrogram can't run without. " "PySocks is missing and Pyrogram can't run without. "
"Please install it using \"pip3 install pysocks\"." "Please install it using \"pip3 install pysocks\"."
) )
raise e
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
Proxy = namedtuple("Proxy", ["enabled", "hostname", "port", "username", "password"]) Proxy = namedtuple("Proxy", ["enabled", "hostname", "port", "username", "password"])

View File

@ -16,19 +16,18 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
import sys
try: try:
import tgcrypto import tgcrypto
except ImportError: except ImportError as e:
sys.exit( e.msg = (
"TgCrypto is missing and Pyrogram can't run without. " "TgCrypto is missing and Pyrogram can't run without. "
"Please install it using \"pip3 install tgcrypto\". " "Please install it using \"pip3 install tgcrypto\". "
"More info: https://docs.pyrogram.ml/resources/TgCrypto" "More info: https://docs.pyrogram.ml/resources/TgCrypto"
) )
raise e
# TODO: Ugly IFs
class AES: class AES:
@classmethod @classmethod
def ige_encrypt(cls, data: bytes, key: bytes, iv: bytes) -> bytes: def ige_encrypt(cls, data: bytes, key: bytes, iv: bytes) -> bytes: