Skip to content

Commit

Permalink
if statement can be simplified
Browse files Browse the repository at this point in the history
Signed-off-by: harshhaareddy <[email protected]>
  • Loading branch information
harshhaareddy committed Mar 29, 2022
1 parent 0cecada commit 6a45086
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 32 deletions.
5 changes: 1 addition & 4 deletions alive.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
BASE_URL = None

IS_VPS = os.environ.get('IS_VPS', 'False')
if IS_VPS.lower() == 'true':
IS_VPS = True
else:
IS_VPS = False
IS_VPS = IS_VPS.lower() == 'true'

if not IS_VPS and BASE_URL is not None:
while True:
Expand Down
35 changes: 7 additions & 28 deletions bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,50 +272,32 @@ def get_client() -> qba.TorrentsAPIMixIn:
IMAGE_URL = 'https://telegra.ph/file/7ac7fa23a5c3d2bbba654.jpg'
try:
STOP_DUPLICATE = getConfig('STOP_DUPLICATE')
if STOP_DUPLICATE.lower() == 'true':
STOP_DUPLICATE = True
else:
STOP_DUPLICATE = False
STOP_DUPLICATE = STOP_DUPLICATE.lower() == 'true'
except KeyError:
STOP_DUPLICATE = False
try:
VIEW_LINK = getConfig('VIEW_LINK')
if VIEW_LINK.lower() == 'true':
VIEW_LINK = True
else:
VIEW_LINK = False
VIEW_LINK = VIEW_LINK.lower() == 'true'
except KeyError:
VIEW_LINK = False
try:
IS_TEAM_DRIVE = getConfig('IS_TEAM_DRIVE')
if IS_TEAM_DRIVE.lower() == 'true':
IS_TEAM_DRIVE = True
else:
IS_TEAM_DRIVE = False
IS_TEAM_DRIVE = IS_TEAM_DRIVE.lower() == 'true'
except KeyError:
IS_TEAM_DRIVE = False
try:
USE_SERVICE_ACCOUNTS = getConfig('USE_SERVICE_ACCOUNTS')
if USE_SERVICE_ACCOUNTS.lower() == 'true':
USE_SERVICE_ACCOUNTS = True
else:
USE_SERVICE_ACCOUNTS = False
USE_SERVICE_ACCOUNTS = USE_SERVICE_ACCOUNTS.lower() == 'true'
except KeyError:
USE_SERVICE_ACCOUNTS = False
try:
BLOCK_MEGA_FOLDER = getConfig('BLOCK_MEGA_FOLDER')
if BLOCK_MEGA_FOLDER.lower() == 'true':
BLOCK_MEGA_FOLDER = True
else:
BLOCK_MEGA_FOLDER = False
BLOCK_MEGA_FOLDER = BLOCK_MEGA_FOLDER.lower() == 'true'
except KeyError:
BLOCK_MEGA_FOLDER = False
try:
BLOCK_MEGA_LINKS = getConfig('BLOCK_MEGA_LINKS')
if BLOCK_MEGA_LINKS.lower() == 'true':
BLOCK_MEGA_LINKS = True
else:
BLOCK_MEGA_LINKS = False
BLOCK_MEGA_LINKS = BLOCK_MEGA_LINKS.lower() == 'true'
except KeyError:
BLOCK_MEGA_LINKS = False
try:
Expand Down Expand Up @@ -344,10 +326,7 @@ def get_client() -> qba.TorrentsAPIMixIn:

try:
IS_VPS = getConfig('IS_VPS')
if IS_VPS.lower() == 'true':
IS_VPS = True
else:
IS_VPS = False
IS_VPS = IS_VPS.lower() == 'true'
except KeyError:
IS_VPS = False

Expand Down

0 comments on commit 6a45086

Please sign in to comment.