Skip to content

Commit

Permalink
Merge pull request #19 from zaytiri/fix-issues
Browse files Browse the repository at this point in the history
Fix issues
  • Loading branch information
zaytiri authored Mar 26, 2023
2 parents d3e3aaa + a5859b5 commit 419797b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion progscheduler/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def is_time_to_stop_valid(program_name, time_to_stop):


def is_scheduled_today(days_to_schedule):
now = datetime.utcnow()
now = datetime.now()
return now.strftime("%A").lower() in days_to_schedule


Expand Down
2 changes: 1 addition & 1 deletion progscheduler/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def open_program(root_path):
now = datetime.utcnow()
now = datetime.now()
os.startfile(root_path)
show('The following file \n\t\t\t\'' + root_path + '\'\n\t\t has started at ' + str(now.hour).zfill(2) + ':' + str(now.minute).zfill(2) + ':' + str(
now.second).zfill(2) + '.')
2 changes: 1 addition & 1 deletion progscheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ def __schedule_method(self, time_to_schedule, day='everyday'):

def __get_now_date(self):
self.__seconds_delay += 1
now = datetime.utcnow() + timedelta(seconds=self.__seconds_delay)
now = datetime.now() + timedelta(seconds=self.__seconds_delay)
return str(now.hour).zfill(2) + ':' + str(now.minute).zfill(2) + ':' + str(now.second).zfill(2)
8 changes: 4 additions & 4 deletions progscheduler/settings/specific_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def add_arguments(self, args_parser):
default=argparse.SUPPRESS)

def process_arguments(self, settings):
self.__check_any_errors()
self.__check_any_errors(settings[0].user_arguments)
self.__process_days(settings[0].user_arguments)

def __process_days(self, user_arguments):
Expand All @@ -104,10 +104,10 @@ def __process_days(self, user_arguments):
elif user_arguments.days[0] == 'everyday':
user_arguments.days = self.__get_specific_days('everyday')

def __check_any_errors(self):
def __check_any_errors(self, user_args):
try:
if not self.__given_argument_path_exists(self.path):
throw(self.path + '\' path does not exist.')
if not self.__given_argument_path_exists(user_args.path):
throw(user_args.path + '\' path does not exist.')
except (AttributeError, TypeError):
pass

Expand Down

0 comments on commit 419797b

Please sign in to comment.