-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lpmatos
committed
Jul 28, 2020
1 parent
91e7af2
commit aeabf4b
Showing
5 changed files
with
96 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
VERSION = (1, 0, 0) | ||
VERSION = (1, 0, 12) | ||
|
||
__version__ = ".".join(map(str, VERSION)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import logging | ||
import logging.handlers | ||
|
||
logging.basicConfig( | ||
level=logging.INFO, | ||
format="%(asctime)s %(levelname)-10s %(processName)s %(name)s %(message)s", | ||
datefmt="%Y-%m-%d-%H-%M-%S" | ||
) | ||
|
||
log = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import subprocess | ||
from typing import Text, Callable | ||
|
||
class Process: | ||
|
||
@staticmethod | ||
def run_command(command: Text) -> Text: | ||
try: | ||
if not isinstance(command, str): | ||
raise ValueError(f"We spec a string value, not {type(command)}") | ||
process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True, universal_newlines=True) | ||
output, errors = process.communicate() | ||
if process.returncode != 0: | ||
sys.stderr.write(f"Run command failed - status returncode - {process.returncode} - {error}") | ||
exit(1) | ||
return (output, errors) | ||
except subprocess.CalledProcessError as error: | ||
sys.stderr.write(f"Subprocess error when run the command {command} - {error}") | ||
exit(1) | ||
except Exception as error: | ||
sys.stderr.write(f"Error general exception in run the command {command} - {error}") | ||
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
digraph tree { | ||
"shared/common/images" [label="shared/common/images"]; | ||
} |