From ec254483f339628b47094d513abaddc93b22a503 Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Tue, 28 Oct 2014 10:33:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B0=D1=80=D0=BA=D0=B5=D1=80=20=D0=B2?= =?UTF-8?q?=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8=20=D0=B7=D0=B0=D0=BF=D1=83?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BD=D0=B0=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5?= =?UTF-8?q?=D1=89=D0=B5=D0=BD=20=D0=B2=20ini.env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/update.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pym/update/update.py b/pym/update/update.py index b462210..f4d8351 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -178,7 +178,7 @@ class Update: if not status: self.printWARNING(_("Updates autocheck is not enabled")) return False - line = EmergeLog(EmergeLogNamedTask("schedule")).get_last_time() + last_check = SystemIni().getVar('update', 'last_check') or "" re_interval = re.compile("^(\d+)\s*(hours?|days?|weeks?)?", re.I) interval_match = re_interval.search(interval) MINUTE = 60 @@ -194,10 +194,9 @@ class Update: est = int(interval_match.group(1)) * k else: est = 3 * HOUR - if line: - linetime = line.partition(":")[0] - if linetime.isdigit(): - if (time.time() - int(linetime)) < (est - 10 * MINUTE): + if last_check: + if last_check.isdigit(): + if (time.time() - int(last_check)) < (est - 10 * MINUTE): self.printWARNING(_("Please wait for the update time")) return False self.mark_schedule() @@ -691,10 +690,10 @@ class Update: elog.mark_end_task(), def mark_schedule(self): - from calculate.update.utils.cl_update import ClUpdateAction - elog = EmergeLog( - EmergeLogNamedTask(ClUpdateAction.log_names['schedule'])) - elog.mark_end_task(), + """ + Установить отметку о запуске запланированной проверки + """ + SystemIni().setVar('update', {'last_check': str(int(time.time()))}) def premerge(self, param, *packages): """