From 0b102e4b3c002698991128eb0975eaefd721564e Mon Sep 17 00:00:00 2001 From: Lukas Schulte-Tickmann Date: Fri, 8 Jan 2021 19:25:47 +0100 Subject: [PATCH] added: pypi release --- .github/FUNDING.yml | 12 ------------ .gitignore | 4 ++++ README.md | 17 +++++++++++++++-- pymap-copy.py | 13 +++++++++++-- setup.py | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+), 16 deletions(-) delete mode 100644 .github/FUNDING.yml create mode 100644 setup.py diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index effdde2..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [Schluggi] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.gitignore b/.gitignore index e18ce9e..4c5947b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ *.idea *~ *.pyc +.pypirc __pycache__ +build/ +dist/ +/pymap_copy.egg-info/ \ No newline at end of file diff --git a/README.md b/README.md index dab1274..75b4e14 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,27 @@ SSL/TLS and STARTTLS support i wrote my own python-based version. I hope you lik - Python >= 3.5 (with pip) ## Installation +### pip (recommended) +1. Install pymap-copy: `python3 -m pip install pymap-copy` +2. Start the program:`pymap-copy.py --help` +> **Upgrade**: `python3 -m pip install --upgrade pymap-copy` + +### whl / release +1. Download the latest [release](https://github.com/Schluggi/pymap-copy/releases/latest) +2. Install the wheel-file: `python3 -m pip install pymap_copy-X.X-py3-none-any.whl` +3. Start the program:`pymap-copy.py --help` +> **Upgrade**: Simply install a newer release + +### git 1. Clone this repo 2. Install the requirements by running `pip3 install -r requirements.txt` 3. Start the program:`./pymap-copy.py --help` +> **Upgrade**: `git pull` ## Simple usage By running the following command the whole structure (folders & mails) from user1 will be copy to the mailbox of user2. ``` -./pymap-copy.py \ +pymap-copy.py \ --source-user=user1 \ --source-server=server1.example.org \ --source-pass=2345678 \ @@ -149,4 +162,4 @@ Possible encryption are `tls`, `ssl` (the same as `tls`), `none` and `starttls`. ## Credits -Created and maintained by Schluggi. +Created and maintained by Lukas Schulte-Tickmann / Schluggi. diff --git a/pymap-copy.py b/pymap-copy.py index 7e3462a..d794087 100755 --- a/pymap-copy.py +++ b/pymap-copy.py @@ -1,4 +1,11 @@ #!/usr/bin/python3 +""" + Copy and transfer IMAP mailboxes +""" +__version__ = '1.0' +__author__ = 'Lukas Schulte-Tickmann' +__url__ = 'https://github.com/Schluggi/pymap-copy' + from argparse import ArgumentParser, ArgumentTypeError from time import time @@ -82,8 +89,10 @@ def login(client, user, password): return False, '{} No active connection'.format(colorize('Error:', color='red', bold=True)) -parser = ArgumentParser(description='Simple python client to copy and transfer IMAP mailboxes ', - epilog='pymap-copy by Schluggi (https://github.com/Schluggi/pymap-copy)') +parser = ArgumentParser(description='Copy and transfer IMAP mailboxes', + epilog='pymap-copy by {} ({})'.format(__author__, __url__)) +parser.add_argument('-v', '--version', help='show version and exit.', action="version", + version='pymap-copy {} by {} ({})'.format(__version__, __author__, __url__)) #: run mode arguments parser.add_argument('-d', '--dry-run', help='copy & creating nothing, just feign', action="store_true") diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f166f95 --- /dev/null +++ b/setup.py @@ -0,0 +1,38 @@ +import setuptools + +with open('README.md') as readme: + long_desc = readme.read() + +setuptools.setup( + name='pymap-copy', + version='1.0', + python_requires='>=3.5', + scripts=['pymap-copy.py'], + author='Lukas Schulte-Tickmann', + author_email='github@das-it-gesicht.de', + description='Copy and transfer IMAP mailboxes ', + long_description=long_desc, + long_description_content_type='text/markdown', + url='https://github.com/Schluggi/pymap-copy', + project_urls={ + 'Source': 'https://github.com/Schluggi/pymap-copy', + 'Tracker': 'https://github.com/Schluggi/pymap-copy/issues', + 'Funding': 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KPG2MY37LCC24&source=url' + }, + packages=setuptools.find_packages(), + py_modules=['imapidle', 'utils'], + install_requires=[ + 'chardet', + 'IMAPClient', + 'six' + ], + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3', + 'Topic :: Communications :: Email :: Post-Office :: IMAP', + 'Topic :: Utilities' + ] +) \ No newline at end of file