Python 3 port:
/!\ this is a huge commit /!\ starting from this commit, SàT is needs Python 3.6+ /!\ SàT maybe be instable or some feature may not work anymore, this will improve with time This patch port backend, bridge and frontends to Python 3. Roughly this has been done this way: - 2to3 tools has been applied (with python 3.7) - all references to python2 have been replaced with python3 (notably shebangs) - fixed files not handled by 2to3 (notably the shell script) - several manual fixes - fixed issues reported by Python 3 that where not handled in Python 2 - replaced "async" with "async_" when needed (it's a reserved word from Python 3.7) - replaced zope's "implements" with @implementer decorator - temporary hack to handle data pickled in database, as str or bytes may be returned, to be checked later - fixed hash comparison for password - removed some code which is not needed anymore with Python 3 - deactivated some code which needs to be checked (notably certificate validation) - tested with jp, fixed reported issues until some basic commands worked - ported Primitivus (after porting dependencies like urwid satext) - more manual fixes
This commit is contained in:
parent
d21a6a660f
commit
fbfe96c505
1 changed files with 6336 additions and 6398 deletions
|
|
@ -18,7 +18,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import base
|
||||
from . import base
|
||||
from sat.core.i18n import _
|
||||
from sat_frontends.jp.constants import Const as C
|
||||
from functools import partial
|
||||
|
|
@ -36,13 +36,13 @@ class Get(base.CommandBase):
|
|||
"get",
|
||||
use_output=C.OUTPUT_DICT,
|
||||
use_verbose=True,
|
||||
help=_(u"get identity data"),
|
||||
help=_("get identity data"),
|
||||
)
|
||||
self.need_loop = True
|
||||
|
||||
def add_parser_options(self):
|
||||
self.parser.add_argument(
|
||||
"jid", type=base.unicode_decoder, help=_(u"entity to check")
|
||||
"jid", help=_("entity to check")
|
||||
)
|
||||
|
||||
def identityGetCb(self, data):
|
||||
|
|
@ -57,7 +57,7 @@ class Get(base.CommandBase):
|
|||
callback=self.identityGetCb,
|
||||
errback=partial(
|
||||
self.errback,
|
||||
msg=_(u"can't get identity data: {}"),
|
||||
msg=_("can't get identity data: {}"),
|
||||
exit_code=C.EXIT_BRIDGE_ERRBACK,
|
||||
),
|
||||
)
|
||||
|
|
@ -71,13 +71,12 @@ class Set(base.CommandBase):
|
|||
self.parser.add_argument(
|
||||
"-f",
|
||||
"--field",
|
||||
type=base.unicode_decoder,
|
||||
action="append",
|
||||
nargs=2,
|
||||
dest="fields",
|
||||
metavar=(u"KEY", u"VALUE"),
|
||||
metavar=("KEY", "VALUE"),
|
||||
required=True,
|
||||
help=_(u"identity field(s) to set"),
|
||||
help=_("identity field(s) to set"),
|
||||
)
|
||||
self.need_loop = True
|
||||
|
||||
|
|
@ -89,7 +88,7 @@ class Set(base.CommandBase):
|
|||
callback=self.host.quit,
|
||||
errback=partial(
|
||||
self.errback,
|
||||
msg=_(u"can't set identity data data: {}"),
|
||||
msg=_("can't set identity data data: {}"),
|
||||
exit_code=C.EXIT_BRIDGE_ERRBACK,
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue