diff --git a/2to3.patch b/2to3.patch deleted file mode 100644 index 6829de4f..00000000 --- a/2to3.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- dbbackup/dbcommands.py (original) -+++ dbbackup/dbcommands.py (refactored) -@@ -13,6 +13,7 @@ - from django.core.management.base import CommandError - from django.utils import timezone - from dbbackup import settings -+import collections - - - class BaseEngineSettings: -@@ -223,7 +224,7 @@ - 'extension': self.settings.extension, - 'wildcard': wildcard, - } -- if callable(settings.FILENAME_TEMPLATE): -+ if isinstance(settings.FILENAME_TEMPLATE, collections.Callable): - filename = settings.FILENAME_TEMPLATE(**params) - else: - params['datetime'] = wildcard or params['timestamp'].strftime(settings.DATE_FORMAT) -@@ -270,7 +271,7 @@ - print(self._clean_passwd(" Running: %s" % ' '.join(command))) - env = self.settings.get_env() - env.update(settings.BACKUP_ENVIRONMENT) -- for k, v in env.items(): -+ for k, v in list(env.items()): - env[k] = self.translate_command(v) - updated_osenv = os.environ.copy() - updated_osenv.update(env) ---- dbbackup/management/commands/dbrestore.py (original) -+++ dbbackup/management/commands/dbrestore.py (refactored) -@@ -76,7 +76,7 @@ - if not self.filepath: - print(" Finding latest backup") - filepaths = self.storage.list_directory() -- filepaths = list(filter(lambda f: f.endswith('.' + self.backup_extension), filepaths)) -+ filepaths = list([f for f in filepaths if f.endswith('.' + self.backup_extension)]) - if not filepaths: - raise CommandError("No backup files found in: /%s" % self.storage.backup_dir) - self.filepath = filepaths[-1] -@@ -94,7 +94,7 @@ - inputfile.close() - inputfile = uncompressed_file - print(" Restore tempfile created: %s" % utils.handle_size(inputfile)) -- cont = input("Are you sure you want to continue? [Y/n]") -+ cont = eval(input("Are you sure you want to continue? [Y/n]")) - if cont.lower() not in ('y', 'yes', ''): - print("Quitting") - sys.exit(0) -@@ -123,7 +123,7 @@ - import gnupg - def get_passphrase(): - print('Input Passphrase: ') -- return input() -+ return eval(input()) - - temp_dir = tempfile.mkdtemp(dir=dbbackup_settings.TMP_DIR) - try: diff --git a/README.rst b/README.rst index c345b06e..61950a27 100644 --- a/README.rst +++ b/README.rst @@ -8,19 +8,37 @@ Django Database Backup :target: https://readthedocs.org/projects/django-dbbackup/?badge=latest :alt: Documentation Status - .. image:: https://coveralls.io/repos/django-dbbackup/django-dbbackup/badge.svg?branch=master&service=github :target: https://coveralls.io/github/django-dbbackup/django-dbbackup?branch=master This Django application provides management commands to help backup and -restore your project database to AmazonS3, Dropbox or Local Disk. +restore your project database and media files with various storages such as +Amazon S3, DropBox or local file storage. + +It is made for: -- Keep your important data secure and offsite. +- Ensure yours backup with GPG signature and encryption +- Archive with compression - Use Crontab or Celery to setup automated backups. - Great to keep your development database up to date. Docs ==== -http://django-dbbackup.readthedocs.org/ +See our offical documentation at `Read The Docs`_. + +Contributing +============ + +All contribution are very welcomed, propositions, problems, bugs and +enhancement are tracked with `GitHub issues`_ system and patch are submitted +via `pull requests`_. + +We use `Travis`_ coupled with `Coveralls`_ as continious integration tools. + +.. _`Read The Docs`: http://django-dbbackup.readthedocs.org/ +.. _`GitHub issues`: https://github.com/django-dbbackup/django-dbbackup/issues +.. _`pull requests`: https://github.com/django-dbbackup/django-dbbackup/pulls +.. _Travis: https://travis-ci.org/django-dbbackup/django-dbbackup +.. _Coveralls: https://coveralls.io/github/django-dbbackup/django-dbbackup diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 6e9f674c..00000000 --- a/TODO.md +++ /dev/null @@ -1,13 +0,0 @@ -# TODO list for django-dbbackup - -'' May 17th 2014 '' - - * Put all common settings in a common management command super-class. - * Clean up file naming and base directory structure - * Add support for rsync and scp - * Use logging instead of print() - * Create a mediarestore command to reflect mediabackup - * Make a proper filesystem log and email that instead of the failure emails - containing sensitive data. - - diff --git a/dbbackup/__init__.py b/dbbackup/__init__.py index f66b69cf..63839094 100644 --- a/dbbackup/__init__.py +++ b/dbbackup/__init__.py @@ -1 +1,6 @@ -VERSION = "2.0.5a" +"Management commands to help backup and restore a project database to \ +AmazonS3, Dropbox or local disk." +VERSION = __version__ = "2.0.5a" +__author__ = 'Michael Shepanski' +__email__ = 'mjs7231@gmail.com' +__url__ = 'https://github.com/django-dbbackup/django-dbbackup' diff --git a/dbbackup/management/commands/dbbackup.py b/dbbackup/management/commands/dbbackup.py index 15723ca3..9de636e0 100644 --- a/dbbackup/management/commands/dbbackup.py +++ b/dbbackup/management/commands/dbbackup.py @@ -39,7 +39,7 @@ def handle(self, **options): self.quiet = options.get('quiet') try: self.clean = options.get('clean') - self.clean_keep = getattr(settings, 'DBBACKUP_CLEANUP_KEEP', 10) + self.clean_keep = settings.CLEANUP_KEEP self.database = options.get('database') self.servername = options.get('servername') self.compress = options.get('compress') diff --git a/requirements-tests.txt b/requirements-tests.txt index ddc6fcf7..41443e87 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -2,3 +2,4 @@ pep8 flake8 mock coverage +python-gnupg diff --git a/setup.py b/setup.py index 74fe1386..c3d74208 100644 --- a/setup.py +++ b/setup.py @@ -1,27 +1,25 @@ -import os from setuptools import setup, find_packages - -from dbbackup import VERSION - - -def get_path(fname): - return os.path.join(os.path.dirname(__file__), fname) +import dbbackup def get_requirements(): return open('requirements.txt').read().splitlines() +def get_test_requirements(): + return open('requirements-tests.txt').read().splitlines() + + setup( name='django-dbbackup', - version=VERSION, - description='Management commands to help backup and restore a project database to AmazonS3, Dropbox or local disk.', - author='Michael Shepanski', - author_email='mjs7231@gmail.com', + version=dbbackup.__version__, + description=dbbackup.__doc__, + author=dbbackup.__author__, + author_email=dbbackup.__email__, install_requires=get_requirements(), - tests_require=('mock', 'python-gnupg'), + tests_require=get_test_requirements(), license='BSD', - url='https://github.com/mjs7231/django-dbbackup', + url='https://github.com/django-dbbackup/django-dbbackup', keywords=['django', 'dropbox', 'database', 'backup', 'amazon', 's3'], packages=find_packages(exclude=['tests.runtests.main']), test_suite='tests.runtests.main',