diff --git a/main/__init__.py b/main/__init__.py index 50932b30..a8498be6 100644 --- a/main/__init__.py +++ b/main/__init__.py @@ -19,17 +19,20 @@ class Config: + """This class generates the configs """ pass def isLocalHost(): + """Check if it is localhost""" return os.path.exists("config.txt") class Tools: + """Use it for installing the required packages """ device = platform.uname()[0].lower() - is_linux = (device=="linux") - is_windows = (device=="windows") + is_linux = device=="linux" + is_windows = device=="windows" @property def clear_screen(self): @@ -39,12 +42,13 @@ def check_command(self, args: list): return (subprocess.run( args, stdout=subprocess.PIPE, - shell=True + shell=True, + check=True )).stdout.decode() def requirements(self): - with open("requirements.txt", "r") as f: + with open("requirements.txt", "r", encoding="UTF-8") as f: return [x.lower().strip() for x in f.read().split("\n") if x not in ("\n", "")] diff --git a/main/core/methods/functions/syncpart.py b/main/core/methods/functions/syncpart.py index 91ff0c15..d53d7a29 100644 --- a/main/core/methods/functions/syncpart.py +++ b/main/core/methods/functions/syncpart.py @@ -47,7 +47,7 @@ def messageobject(anydict: dict): ] try: # the passed message object - # must be at the top + # must be at the top return all_messages[0] except IndexError: return None @@ -69,6 +69,7 @@ class Types(object): class SyncPart(Types): + """You must use this class with inherited Config class""" def showdate( self ): @@ -153,7 +154,7 @@ def textlen( """ if self.is_bot: raise BotMethodInvalid - + frame = inspect.currentframe().f_back m = messageobject(frame.f_locals) @@ -878,13 +879,13 @@ def Ytdl( ): """ Just read the YoutubeDL class docs for use - + params:: params: dict = { "format": "bestaudio[ext=webm]", "noplaylist": "true" }, - + auto_init: bool = True """ @@ -892,7 +893,7 @@ def Ytdl( params=params, auto_init=auto_init ) - + return yt @@ -931,4 +932,4 @@ def createThread(func: callable, start_now: bool=True, *_args, **_kwargs): if start_now: return thread.start() else: - return thread \ No newline at end of file + return thread