Skip to content

Commit

Permalink
PEP8 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lra committed Feb 22, 2014
1 parent cae361b commit 5bf4931
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
31 changes: 16 additions & 15 deletions mackup/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
ENGINE_GDRIVE,
ENGINE_FS)

from utils import (get_dropbox_folder_location,
from utils import (error,
get_dropbox_folder_location,
get_google_drive_folder_location)

try:
Expand Down Expand Up @@ -112,18 +113,18 @@ def _warn_on_old_config(self):
old_sections = ['Allowed Applications', 'Ignored Applications']
for old_section in old_sections:
if self._parser.has_section(old_section):
utils.error("Old config file detected. Aborting.\n"
"\n"
"An old section (e.g. [Allowed Applications]"
" or [Ignored Applications] has been detected"
" in your {} file.\n"
"I'd rather do nothing than do something you"
" do not want me to do.\n"
"\n"
"Please read the up to date documentation on"
" <https://github.com/lra/mackup> and migrate"
" your configuration file."
.format(path_to_cfg))
error("Old config file detected. Aborting.\n"
"\n"
"An old section (e.g. [Allowed Applications]"
" or [Ignored Applications] has been detected"
" in your {} file.\n"
"I'd rather do nothing than do something you"
" do not want me to do.\n"
"\n"
"Please read the up to date documentation on"
" <https://github.com/lra/mackup> and migrate"
" your configuration file."
.format(MACKUP_CONFIG_FILE))

def _parse_engine(self):
"""
Expand Down Expand Up @@ -156,8 +157,8 @@ def _parse_path(self):
cfg_path = self._parser.get('storage', 'path')
path = os.path.join(os.environ['HOME'], cfg_path)
else:
raise ConfigError("The required 'path' can't be found while the"
" 'file_system' engine is used.")
raise ConfigError("The required 'path' can't be found while"
" the 'file_system' engine is used.")

return str(path)

Expand Down
1 change: 0 additions & 1 deletion mackup/mackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import shutil
import tempfile

from . import constants
from . import utils
from . import config

Expand Down
4 changes: 2 additions & 2 deletions mackup/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ def parse_cmdline_args():

# Format some epilog text
epilog = ("Mackup modes of action:\n"
" - backup: sync your conf files to your synced storage, use this"
" the 1st time you use Mackup.\n"
" - backup: sync your conf files to your synced storage, use"
" this the 1st time you use Mackup.\n"
" - restore: link the conf files already in your synced storage"
" on your system, use it on any new system you use.\n"
" - uninstall: reset everything as it was before using Mackup.\n"
Expand Down
2 changes: 0 additions & 2 deletions tests/config_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
ENGINE_GDRIVE,
ENGINE_FS)
from mackup.config import Config, ConfigError
from mackup import utils


class TestConfig(unittest.TestCase):
Expand All @@ -14,7 +13,6 @@ def setUp(self):
realpath = os.path.dirname(os.path.realpath(__file__))
os.environ['HOME'] = os.path.join(realpath, 'fixtures')


def test_config_empty(self):
cfg = Config('mackup-empty.cfg')

Expand Down

0 comments on commit 5bf4931

Please sign in to comment.