|
|
|
@ -13,10 +13,13 @@
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
from itertools import ifilter
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
from os import path
|
|
|
|
|
import os
|
|
|
|
|
import time
|
|
|
|
|
from calculate.core.server.gen_pid import search_worked_process
|
|
|
|
|
|
|
|
|
|
from calculate.lib.utils.tools import AddonError
|
|
|
|
|
from calculate.lib.utils.colortext.palette import TextState
|
|
|
|
@ -99,6 +102,24 @@ class Update:
|
|
|
|
|
dv.Set('cl_update_outdate_set', 'on', force=True)
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def checkRun(self, wait_update):
|
|
|
|
|
"""
|
|
|
|
|
Проверить повторный запуск
|
|
|
|
|
"""
|
|
|
|
|
dv = self.clVars
|
|
|
|
|
if filter(lambda x: os.getpid() != x,
|
|
|
|
|
search_worked_process('update', dv)):
|
|
|
|
|
if not wait_update:
|
|
|
|
|
raise UpdateError(_("Update is already running. "
|
|
|
|
|
"Try to run later."))
|
|
|
|
|
else:
|
|
|
|
|
self.startTask(_("Waiting for complete another update"))
|
|
|
|
|
while any(ifilter(lambda x: os.getpid() != x,
|
|
|
|
|
search_worked_process('update', dv))):
|
|
|
|
|
time.sleep(0.3)
|
|
|
|
|
self.endTask()
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def syncRepositories(self, repname, clean_on_error=True):
|
|
|
|
|
"""
|
|
|
|
|
Синхронизировать репозитории
|
|
|
|
|