Browse Source

Переход на константы-ветки

develop
Mike Khiretskiy 7 years ago
parent
commit
ee4f335ba9
  1. 2
      pym/update/profile.py
  2. 2
      pym/update/update.py
  3. 17
      pym/update/variables/update.py
  4. 2
      pym/update/wsdl_update.py

2
pym/update/profile.py

@ -25,7 +25,7 @@ from update import UpdateError
from calculate.lib.cl_lang import setLocalTranslate, _
setLocalTranslate('cl_update3', sys.modules[__name__])
DEFAULT_BRANCH = "master"
DEFAULT_BRANCH = Git.Reference.Master
class RepositoryStorage(object):

2
pym/update/update.py

@ -1135,7 +1135,7 @@ class Update(object):
def message_binhost_changed(self):
if self.refresh_binhost:
self.printWARNING(_("Binhost was changed to %s") %
self.printWARNING(_("Update server was changed to %s") %
self.clVars.Get('cl_update_binhost'))
return True

17
pym/update/variables/update.py

@ -23,6 +23,7 @@ from calculate.lib.datavars import (Variable, VariableError,
SimpleDataVars, DataVarsError)
from calculate.lib.utils.files import readFile, \
listDirectory, process, pathJoin
from calculate.lib.utils.git import Git
from calculate.lib.configparser import ConfigParser
from calculate.lib.cl_lang import setLocalTranslate
@ -206,7 +207,7 @@ class VariableClUpdateRepRev(Variable):
for repname, branchname in zip(
self.Get('cl_update_rep_name'),
self.Get('cl_update_branch_name')):
if branchname == "binhost":
if branchname == Git.Reference.Tag:
yield cp.get("vcs", repname, fallback=branch)
else:
yield branchname
@ -217,7 +218,7 @@ class VariableClUpdateBranch(Variable):
"""
Ветка на которую будет обновляться репозиторий если -getbinpkg
"""
value = "master"
value = Git.Reference.Master
class VariableClUpdateBranchData(TableVariable):
"""
@ -337,8 +338,8 @@ class VariableClUpdateBinhostRecheckSet(Variable):
opt = ["--recheck-binhost"]
def init(self):
self.help = _("re-check binary hosts")
self.label = _("Re-check binary hosts")
self.help = _("re-check most relevant update server")
self.label = _("Re-check most relevant update server")
class VariableClUpdateBinhostHost(FieldValue, ReadonlyVariable):
@ -376,11 +377,15 @@ class VariableClUpdateBranchName(Variable):
self.label = _("Branches")
def choice(self):
return ["master", "develop", "update", "binhost"]
return [
Git.Reference.Tag,
Git.Reference.Master,
Git.Reference.Develop,
Git.Reference.Update]
def get(self):
if "getbinpkg" in self.Get('cl_features'):
return ["binhost" for x in self.Get('cl_update_rep_name')]
return [Git.Reference.Tag for x in self.Get('cl_update_rep_name')]
else:
branch = self.Get('cl_update_branch')
return [branch for x in self.Get('cl_update_rep_name')]

2
pym/update/wsdl_update.py

@ -93,7 +93,7 @@ class Wsdl(WsdlBase):
# заголовок метода
'title': __("Change the Profile"),
# иконка для графической консоли
'image': 'dialog-information',
'image': 'notification-display-brightness-full,gtk-dialog-info',
# метод присутствует в графической консоли
'gui': True,
# консольная команда

Loading…
Cancel
Save