Categorise modules according to their jobs

Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
lzzy12 2019-10-07 20:06:23 +05:30
parent e49445c603
commit d36ba18a9f
18 changed files with 25 additions and 29 deletions

View File

@ -1,12 +1,13 @@
from telegram.ext import CommandHandler, run_async
from bot import dispatcher, LOGGER, updater, aria2
import bot.mirror, bot.list, bot.mirror_status, bot.cancel_mirror, bot.authorize
from bot.helper import fs_utils
from bot import dispatcher, LOGGER, updater
from bot.helper.ext_utils import fs_utils
import signal
import time
from bot.helper.message_utils import *
from bot.helper.telegram_helper.message_utils import *
import shutil
from .helper.telegram_helper.filters import CustomFilters
from .modules import *
@run_async
def disk_usage(update, context):

View File

@ -1,3 +0,0 @@
class Config(object):
"""docstring for Config"""

View File

View File

View File

@ -1,5 +1,5 @@
from bot import aria2, DOWNLOAD_DIR
from .bot_utils import get_readable_file_size, MirrorStatus
from bot.helper.ext_utils.bot_utils import get_readable_file_size, MirrorStatus
def get_download(gid):

View File

@ -1,8 +1,8 @@
from time import sleep
from bot import DOWNLOAD_DIR, DOWNLOAD_STATUS_UPDATE_INTERVAL, aria2
from .download_status import DownloadStatus
from .bot_utils import *
from .exceptions import KillThreadException
from bot.helper.ext_utils.bot_utils import *
from bot.helper.ext_utils.exceptions import KillThreadException
class DownloadHelper:

View File

@ -5,11 +5,10 @@ from googleapiclient.http import MediaFileUpload
import pickle
import os
import time
import logging
from bot import LOGGER, parent_id, DOWNLOAD_DIR
from .fs_utils import get_mime_type
from .bot_utils import *
from .exceptions import KillThreadException
from bot.helper.ext_utils.fs_utils import get_mime_type
from bot.helper.ext_utils.bot_utils import *
from bot.helper.ext_utils.exceptions import KillThreadException
logging.getLogger('googleapiclient.discovery').setLevel(logging.ERROR)

0
bot/modules/__init__.py Normal file
View File

View File

@ -1,8 +1,8 @@
from .helper.message_utils import sendMessage
from bot.helper.telegram_helper.message_utils import sendMessage
from telegram.ext import run_async
from bot import AUTHORIZED_CHATS, dispatcher
from telegram.ext import CommandHandler
from .helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper.filters import CustomFilters
from telegram.ext import Filters
from telegram import Update

View File

@ -1,7 +1,7 @@
from telegram.ext import CommandHandler, run_async
from bot.helper.message_utils import *
from bot.helper.telegram_helper.message_utils import *
from bot import download_dict, aria2, dispatcher, download_dict_lock
from .helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper.filters import CustomFilters
@run_async
def cancel_mirror(update: Update, context):

View File

@ -1,6 +1,5 @@
from telegram.ext import CommandHandler, run_async
from telegram.error import BadRequest
from bot.helper.gdriveTools import GoogleDriveHelper
from bot.helper.mirror_utils.gdriveTools import GoogleDriveHelper
from bot import LOGGER, dispatcher

View File

@ -1,13 +1,13 @@
from telegram.ext import CommandHandler, run_async
from telegram.error import BadRequest
from bot.helper import download_tools, gdriveTools, listeners
from bot.helper.mirror_utils import download_tools, gdriveTools, listeners
from bot import LOGGER, dispatcher
from bot.helper import fs_utils
from bot.helper.ext_utils import fs_utils
from bot import download_dict, status_reply_dict, status_reply_dict_lock, download_dict_lock
from bot.helper.message_utils import *
from bot.helper.bot_utils import get_readable_message, MirrorStatus
from bot.helper.exceptions import KillThreadException
from .helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper.message_utils import *
from bot.helper.ext_utils.bot_utils import get_readable_message, MirrorStatus
from bot.helper.ext_utils.exceptions import KillThreadException
from bot.helper.telegram_helper.filters import CustomFilters
class MirrorListener(listeners.MirrorListeners):
def __init__(self, context, update, reply_message):

View File

@ -1,10 +1,10 @@
from telegram.ext import CommandHandler, run_async
from bot import dispatcher, status_reply_dict, DOWNLOAD_STATUS_UPDATE_INTERVAL, status_reply_dict_lock
from bot.helper.message_utils import *
from bot.helper.telegram_helper.message_utils import *
from time import sleep
from bot.helper.bot_utils import get_readable_message
from bot.helper.ext_utils.bot_utils import get_readable_message
from telegram.error import BadRequest
from .helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper.filters import CustomFilters
@run_async
def mirror_status(update: Update, context):