From 2149f67ff935c3c8a22aee4056e48854d6944a96 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Sun, 11 Nov 2018 13:02:19 +0100 Subject: [PATCH] Remove support for Copy engine as the service has been discontinued --- CHANGELOG.md | 1 + README.md | 1 - doc/.mackup.cfg | 5 --- mackup/config.py | 7 +--- mackup/constants.py | 1 - mackup/utils.py | 30 ------------------ tests/config_tests.py | 21 ------------ .../Application Support/Copy Agent/config.db | Bin 3072 -> 0 bytes tests/fixtures/mackup-engine-copy.cfg | 12 ------- tests/utils_test.py | 8 +---- 10 files changed, 3 insertions(+), 83 deletions(-) delete mode 100644 tests/fixtures/Library/Application Support/Copy Agent/config.db delete mode 100644 tests/fixtures/mackup-engine-copy.cfg diff --git a/CHANGELOG.md b/CHANGELOG.md index 70f0815fd..2065e8b7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Add support for hstr (via @paxperscientiam) - Add support for b-ryan/powerline-shell (via @paxperscientiam) - Add support for kovidgoyal/kitty (via @foray1010) +- Remove support for Copy engine as the service has been discontinued (via @sonnyp) ## Mackup 0.8.20 diff --git a/README.md b/README.md index d7117d10f..d2de976e6 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,6 @@ in it stay put, so that any other computer also running Mackup is unaffected. - [Dropbox](https://www.dropbox.com/) - [Google Drive](https://drive.google.com/) -- [Copy](https://www.copy.com/) - [iCloud](http://www.apple.com/icloud/) - [Box](https://www.box.com) - Anything able to sync a folder (e.g. [Git](http://git-scm.com/)) diff --git a/doc/.mackup.cfg b/doc/.mackup.cfg index 26dcf1a16..25f3620f7 100644 --- a/doc/.mackup.cfg +++ b/doc/.mackup.cfg @@ -16,11 +16,6 @@ engine = dropbox # [storage] # engine = google_drive -# If you choose the "copy" storage engine, Mackup will figure -# out where your Copy folder is and store your configuration files in it. -# [storage] -# engine = copy - # If you want to specify another directory, you can use the "file_system" # engine and Mackup won't try to detect any path for you: it will store your # files where you explicitly told him to, using the "path" setting. diff --git a/mackup/config.py b/mackup/config.py index 0c448544a..574d60f59 100644 --- a/mackup/config.py +++ b/mackup/config.py @@ -7,14 +7,12 @@ MACKUP_CONFIG_FILE, ENGINE_DROPBOX, ENGINE_GDRIVE, - ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX, ENGINE_FS) from .utils import (error, get_dropbox_folder_location, - get_copy_folder_location, get_google_drive_folder_location, get_icloud_folder_location, get_box_folder_location) @@ -64,7 +62,7 @@ def engine(self): """ The engine used by the storage. - ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX + ENGINE_DROPBOX, ENGINE_GDRIVE, ENGINE_ICLOUD, ENGINE_BOX or ENGINE_FS. Returns: @@ -184,7 +182,6 @@ def _parse_engine(self): if engine not in [ENGINE_DROPBOX, ENGINE_GDRIVE, - ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX, ENGINE_FS]: @@ -203,8 +200,6 @@ def _parse_path(self): path = get_dropbox_folder_location() elif self.engine == ENGINE_GDRIVE: path = get_google_drive_folder_location() - elif self.engine == ENGINE_COPY: - path = get_copy_folder_location() elif self.engine == ENGINE_ICLOUD: path = get_icloud_folder_location() elif self.engine == ENGINE_BOX: diff --git a/mackup/constants.py b/mackup/constants.py index 9df6fa1fe..8b07af3fe 100644 --- a/mackup/constants.py +++ b/mackup/constants.py @@ -23,7 +23,6 @@ # Supported engines ENGINE_BOX = 'box' -ENGINE_COPY = 'copy' ENGINE_DROPBOX = 'dropbox' ENGINE_FS = 'file_system' ENGINE_GDRIVE = 'google_drive' diff --git a/mackup/utils.py b/mackup/utils.py index c3b485aa7..caec69a1a 100644 --- a/mackup/utils.py +++ b/mackup/utils.py @@ -266,36 +266,6 @@ def get_box_folder_location(): return box_home -def get_copy_folder_location(): - """ - Try to locate the Copy folder. - - Returns: - (str) Full path to the current Copy folder - """ - copy_settings_path = 'Library/Application Support/Copy Agent/config.db' - copy_home = None - - copy_settings = os.path.join(os.environ['HOME'], copy_settings_path) - - if os.path.isfile(copy_settings): - database = sqlite3.connect(copy_settings) - if database: - cur = database.cursor() - query = ("SELECT value " - "FROM config2 " - "WHERE option = 'csmRootPath';") - cur.execute(query) - data = cur.fetchone() - copy_home = str(data[0]) - cur.close() - - if not copy_home: - error("Unable to find your Copy install =(") - - return copy_home - - def get_icloud_folder_location(): """ Try to locate the iCloud Drive folder. diff --git a/tests/config_tests.py b/tests/config_tests.py index dd363c27e..a994e0f7e 100644 --- a/tests/config_tests.py +++ b/tests/config_tests.py @@ -3,7 +3,6 @@ from mackup.constants import (ENGINE_DROPBOX, ENGINE_GDRIVE, - ENGINE_COPY, ENGINE_ICLOUD, ENGINE_BOX, ENGINE_FS) @@ -131,26 +130,6 @@ def test_config_engine_google_drive(self): 'sabnzbd']) assert cfg.apps_to_sync == set(['sublime-text-3', 'x11', 'sabnzbd']) - def test_config_engine_copy(self): - cfg = Config('mackup-engine-copy.cfg') - - assert isinstance(cfg.engine, str) - assert cfg.engine == ENGINE_COPY - - assert isinstance(cfg.path, str) - assert cfg.path == u'/Users/someuser/Copy' - - assert isinstance(cfg.directory, str) - assert cfg.directory == u'Mackup' - - assert isinstance(cfg.fullpath, str) - assert cfg.fullpath.endswith(u'/Copy/Mackup') - - assert cfg.apps_to_ignore == set(['subversion', - 'sequel-pro', - 'sabnzbd']) - assert cfg.apps_to_sync == set(['sublime-text-3', 'x11', 'sabnzbd']) - def test_config_engine_icloud(self): cfg = Config('mackup-engine-icloud.cfg') diff --git a/tests/fixtures/Library/Application Support/Copy Agent/config.db b/tests/fixtures/Library/Application Support/Copy Agent/config.db deleted file mode 100644 index 5903ca1db9a59ff2815980f9526844785e96b04b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHJOKcle6n(!IrI0#b;t+xzxh6!eb(2VL;^tF{@=2a&p6wyy8F%K{ zYL@LFB*dochy@a`uaH1u*A1eZELZ{+g#Z(U@ja60R9O8z~Wo~K=Fgr1#y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..000000000 --- a/tests/fixtures/mackup-engine-copy.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[storage] -engine = copy - -[applications_to_ignore] -subversion -sequel-pro -sabnzbd - -[applications_to_sync] -sabnzbd -sublime-text-3 -x11 diff --git a/tests/utils_test.py b/tests/utils_test.py index d962bd4e4..956a982e2 100644 --- a/tests/utils_test.py +++ b/tests/utils_test.py @@ -280,7 +280,7 @@ def test_error(self): def test_failed_backup_location(self): """ Tests for the error that should occur if the backup folder cannot be - found for Dropbox, Google, Box and Copy + found for Dropbox, Google and Box """ # Hack to make our home folder some temporary folder temp_home = tempfile.mkdtemp() @@ -302,12 +302,6 @@ def test_failed_backup_location(self): "Library/Application Support/Box/Box Sync/sync_root_folder.txt")) self.assertRaises(SystemExit, utils.get_box_folder_location) - # Check for the missing Copy Folder - assert not os.path.exists(os.path.join( - temp_home, - "Library/Application Support/Copy Agent/config.db")) - self.assertRaises(SystemExit, utils.get_copy_folder_location) - def test_is_process_running(self): # A pgrep that has one letter and a wildcard will always return id 1 assert utils.is_process_running("a*")