Skip to content

Commit

Permalink
Merge pull request #25 from digitronik/move_to_rumel
Browse files Browse the repository at this point in the history
remove pyyaml and introduce rumel.yaml
  • Loading branch information
digitronik authored Apr 30, 2019
2 parents 49c0f21 + db55ad8 commit 457a33e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions miqsel/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import click
import yaml
from ruamel.yaml import safe_load, safe_dump


class Configuration(object):
Expand All @@ -14,11 +14,11 @@ def __init__(self, conf_file=None):

def read(self):
with open(self.conf_file, "r") as ymlfile:
return yaml.load(ymlfile)
return safe_load(ymlfile)

def write(self, cfg):
with open(self.conf_file, "w") as ymlfile:
return yaml.safe_dump(cfg, ymlfile, default_flow_style=False)
return safe_dump(cfg, ymlfile, default_flow_style=False)


@click.command(help="Configure Miq Selenium Server")
Expand Down
10 changes: 5 additions & 5 deletions miqsel/env.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import click
import yaml
from ruamel.yaml import safe_load, safe_dump

from miqsel.config import Configuration

Expand Down Expand Up @@ -37,19 +37,19 @@ def env_file(self):

@property
def in_env(self):
""" Check env.local.yaml exist or not
""" Check we are in env or not.
:return: return bool
"""
proj_dir = os.path.dirname(self.env_file)
return os.path.isdir(proj_dir) and proj_dir == "conf"
return os.path.isdir(proj_dir)

def read(self):
"""Read Environment file
:return: dict
"""
with open(self.env_file, "r") as ymlfile:
return yaml.load(ymlfile)
return safe_load(ymlfile)

def write(self, cfg):
""" Write Environment file
Expand All @@ -58,7 +58,7 @@ def write(self, cfg):
"""
if self.in_env:
with open(self.env_file, "w") as ymlfile:
return yaml.safe_dump(cfg, ymlfile, default_flow_style=False)
return safe_dump(cfg, ymlfile, default_flow_style=False)
else:
click.echo(
"Project directory need set or run from Project directory; 'env.yaml' not updated"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with open("README.md") as readme_file:
readme = readme_file.read()

install_requirements = ["Click>=5.0", "docker>=3.1", "PyYAML>=3.0"]
install_requirements = ["Click>=5.0", "docker>=3.1", "ruamel.yaml~=0.15"]

setup_requirements = ["setuptools_scm"]

Expand Down

0 comments on commit 457a33e

Please sign in to comment.