Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Update to v3.7.28
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Mishchenko committed Sep 16, 2021
1 parent 16283c0 commit 59b9e87
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion insomniac/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
__title__ = 'insomniac'
__description__ = 'Simple Instagram bot for automated Instagram interaction using Android.'
__url__ = 'https://github.com/alexal1/Insomniac/'
__version__ = '3.7.27'
__version__ = '3.7.28'
__debug_mode__ = False
__author__ = 'Insomniac Team'
__author_email__ = 'info@insomniac-bot.com'
Expand Down
2 changes: 1 addition & 1 deletion insomniac/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def update_session_speed(args):
def should_close_app_after_session(args, device_wrapper):
if args.repeat is None:
return True
if float(args.repeat) > 0:
if not is_zero_value(args.repeat):
return True
return not Session.is_next_app_id_same(args, device_wrapper)

Expand Down
23 changes: 19 additions & 4 deletions insomniac/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,16 @@ def execute_command(cmd) -> Optional[str]:
except IndexError:
# There's a bug in some Python versions that raises this error https://github.com/python/cpython/pull/24777
return None
err = cmd_res.stderr.strip()
if err:
print(COLOR_FAIL + err + COLOR_ENDC)
err = cmd_res.stderr
out = cmd_res.stdout
if err is not None:
err = err.strip()
if len(err) > 0:
print(COLOR_FAIL + err.strip() + COLOR_ENDC)
return None
return cmd_res.stdout.strip()
if out is not None:
return out.strip()
return None


def save_crash(device, ex=None):
Expand Down Expand Up @@ -293,6 +298,16 @@ def print_error():
return value


def is_zero_value(count: str) -> bool:
parts = count.split("-")
if len(parts) == 1:
try:
return float(count) == 0
except ValueError:
pass
return False


def get_left_right_values(left_right_str, name, default):
def print_error():
print(COLOR_FAIL + name.format(default) + f". Using default value instead of \"{left_right_str}\", because it "
Expand Down

0 comments on commit 59b9e87

Please sign in to comment.