|
|
|
@ -27,7 +27,7 @@ from calculate.lib.datavars import (Variable, VariableError,
|
|
|
|
|
SimpleDataVars, DataVarsError)
|
|
|
|
|
from calculate.lib.utils.binhosts import (Binhosts, PackagesIndex, HOURS,
|
|
|
|
|
BinhostSignError)
|
|
|
|
|
from calculate.lib.utils.files import readFile, listDirectory, process, pathJoin
|
|
|
|
|
from calculate.lib.utils.files import readFile, listDirectory, process, pathJoin, quite_unlink
|
|
|
|
|
|
|
|
|
|
from calculate.lib.configparser import ConfigParser
|
|
|
|
|
from calculate.lib.cl_lang import setLocalTranslate
|
|
|
|
@ -932,13 +932,22 @@ class VariableClUpdateProfileDependUrl(FieldValue, ReadonlyVariable):
|
|
|
|
|
self.label = _("URL")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateProfileCheckSync(Variable):
|
|
|
|
|
class VariableClUpdateProfileCheckSyncAllowed(Variable):
|
|
|
|
|
urls = 'cl_update_rep_url'
|
|
|
|
|
names = 'cl_update_rep_name'
|
|
|
|
|
path = 'cl_update_profile_path'
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
if not self.Get(self.urls) or not self.Get(self.names):
|
|
|
|
|
return False
|
|
|
|
|
repos = self.Get(self.path)
|
|
|
|
|
try:
|
|
|
|
|
for rep in repos:
|
|
|
|
|
with open(f'{rep}/test', 'w') as inf:
|
|
|
|
|
inf.write("test")
|
|
|
|
|
quite_unlink(f"{rep}/test")
|
|
|
|
|
except OSError:
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|