Reformat code and optimize imports

This commit is contained in:
Dan 2018-12-18 09:50:39 +01:00
parent 27052e31ca
commit 914dfca574
2 changed files with 4 additions and 4 deletions

View File

@ -1135,13 +1135,13 @@ class Client(Methods, BaseClient):
progress_args: tuple = ()): progress_args: tuple = ()):
part_size = 512 * 1024 part_size = 512 * 1024
file_size = os.path.getsize(path) file_size = os.path.getsize(path)
if file_size == 0: if file_size == 0:
raise ValueError("File size equals to 0 B") raise ValueError("File size equals to 0 B")
if file_size > 1500 * 1024 * 1024: if file_size > 1500 * 1024 * 1024:
raise ValueError("Telegram doesn't support uploading files bigger than 1500 MiB") raise ValueError("Telegram doesn't support uploading files bigger than 1500 MiB")
file_total_parts = int(math.ceil(file_size / part_size)) file_total_parts = int(math.ceil(file_size / part_size))
is_big = True if file_size > 10 * 1024 * 1024 else False is_big = True if file_size > 10 * 1024 * 1024 else False
is_missing_part = True if file_id is not None else False is_missing_part = True if file_id is not None else False

View File

@ -16,9 +16,9 @@
# 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 pyrogram
from pyrogram.api import functions, types, errors from pyrogram.api import functions, types, errors
from ...ext import BaseClient from ...ext import BaseClient
import pyrogram
class GetChatMember(BaseClient): class GetChatMember(BaseClient):