# Path: igor/log.py
# def configure(fn):
# def backlog():
# def getLogger(name):


from igor import log
from lxml import etree
import os
import re
import shlex
import tempfile
import threading
import urllib
import yaml
    import subprocess
    import string
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Author: Fabian Deutsch <fabiand@fedoraproject.org>
#
# -*- coding: utf-8 -*-


logger = log.getLogger(__name__)


def run(cmd, with_retval=False):
    logger.debug("Running: %s" % cmd)
    child = subprocess.Popen(cmd, shell=True,
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE)
    (stdout, stderr) = child.communicate()
    # pylint: disable-msg=E1101
    child.wait()
    if stderr:
        logger.warning(stderr)
    r = str(stdout).strip()
    if with_retval:
        r = (child.returncode, str(stdout).strip())
    # pylint: enable-msg=E1101
    return r


def dict_to_args(d):
    return " ".join(["--%s" % k if v is None else

# Path: igor/log.py
# def configure(fn):
# def backlog():
# def getLogger(name):


# Path: igor/utils.py
from igor import log
from lxml import etree
import os
import re
import shlex
import tempfile
import threading
import urllib
import yaml
    import subprocess
    import string

# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Author: Fabian Deutsch <fabiand@fedoraproject.org>
#
# -*- coding: utf-8 -*-


logger = log.getLogger(__name__)


def run(cmd, with_retval=False):
    logger.debug("Running: %s" % cmd)
    child = subprocess.Popen(cmd, shell=True,
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE)
    (stdout, stderr) = child.communicate()
    # pylint: disable-msg=E1101
    child.wait()
    if stderr:
        logger.warning(stderr)
    r = str(stdout).strip()
    if with_retval:
        r = (child.returncode, str(stdout).strip())
    # pylint: enable-msg=E1101
    return r


def dict_to_args(d):
    return " ".join(["--%s" % k if v is None else

                     "--%s=%s" % (k, v)