plugin mr mercurial, tools(common/utils): moved command protocol to a new module

This commit is contained in:
Goffi 2019-01-25 09:06:29 +01:00
commit 8a59034935

View file

@ -21,12 +21,7 @@
import unicodedata
import os.path
from sat.core.constants import Const as C
from sat.core.log import getLogger
log = getLogger(__name__)
import datetime
from twisted.python import procutils
import subprocess
import time
import sys
@ -34,6 +29,11 @@ import random
import inspect
import textwrap
import functools
from twisted.python import procutils
from sat.core.constants import Const as C
from sat.core.log import getLogger
log = getLogger(__name__)
NO_REPOS_DATA = u"repository data unknown"
@ -56,6 +56,12 @@ def clean_ustr(ustr):
return "".join(valid_chars(ustr))
def logError(failure_):
"""Genertic errback which log the error as a warning, and re-raise it"""
log.warning(failure_.value)
raise failure_
def partial(func, *fixed_args, **fixed_kwargs):
# FIXME: temporary hack to workaround the fact that inspect.getargspec is not working with functools.partial
# making partial unusable with current D-bus module (in addMethod).