diff options
author | Oliver Poignant <oliver@poignant.se> | 2017-01-03 17:19:25 +0100 |
---|---|---|
committer | Oliver Poignant <oliver@poignant.se> | 2017-01-03 17:19:25 +0100 |
commit | f48093c4415c04b070886c19bdc2fcc7c12fcbd0 (patch) | |
tree | 93ea57bc3064fd10d37b9b8d3db07a91b57c499a /gitautodeploy/wrappers | |
parent | 644d98ca85730bf2abb494e45e35b95bc370648b (diff) | |
download | Git-Auto-Deploy-f48093c4415c04b070886c19bdc2fcc7c12fcbd0.zip Git-Auto-Deploy-f48093c4415c04b070886c19bdc2fcc7c12fcbd0.tar.gz Git-Auto-Deploy-f48093c4415c04b070886c19bdc2fcc7c12fcbd0.tar.bz2 |
Compatibility with python >= 3.4
Diffstat (limited to 'gitautodeploy/wrappers')
-rw-r--r-- | gitautodeploy/wrappers/__init__.py | 4 | ||||
-rw-r--r-- | gitautodeploy/wrappers/git.py | 8 | ||||
-rw-r--r-- | gitautodeploy/wrappers/process.py | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/gitautodeploy/wrappers/__init__.py b/gitautodeploy/wrappers/__init__.py index d7df44b..aad49c9 100644 --- a/gitautodeploy/wrappers/__init__.py +++ b/gitautodeploy/wrappers/__init__.py @@ -1,2 +1,2 @@ -from git import * -from process import *
\ No newline at end of file +from .git import * +from .process import *
\ No newline at end of file diff --git a/gitautodeploy/wrappers/git.py b/gitautodeploy/wrappers/git.py index 910e9f6..1f7fe23 100644 --- a/gitautodeploy/wrappers/git.py +++ b/gitautodeploy/wrappers/git.py @@ -9,7 +9,7 @@ class GitWrapper(): def init(repo_config): """Init remote url of the repo from the git server""" import logging - from process import ProcessWrapper + from .process import ProcessWrapper import os import platform @@ -49,7 +49,7 @@ class GitWrapper(): def pull(repo_config): """Pulls the latest version of the repo from the git server""" import logging - from process import ProcessWrapper + from .process import ProcessWrapper import os import platform @@ -93,7 +93,7 @@ class GitWrapper(): def clone(repo_config): """Clones the latest version of the repo from the git server""" import logging - from process import ProcessWrapper + from .process import ProcessWrapper import os import platform @@ -127,7 +127,7 @@ class GitWrapper(): @staticmethod def deploy(repo_config): """Executes any supplied post-pull deploy command""" - from process import ProcessWrapper + from .process import ProcessWrapper import logging logger = logging.getLogger() diff --git a/gitautodeploy/wrappers/process.py b/gitautodeploy/wrappers/process.py index 30adc36..867e6cf 100644 --- a/gitautodeploy/wrappers/process.py +++ b/gitautodeploy/wrappers/process.py @@ -20,6 +20,10 @@ class ProcessWrapper(): p = Popen(*popenargs, **kwargs) stdout, stderr = p.communicate() + # Decode bytes to string (assume utf-8 encoding) + stdout = stdout.decode("utf-8") + stderr = stderr.decode("utf-8") + if stdout: for line in stdout.strip().split("\n"): logger.info(line) |