-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 51cb3c2
Showing
7 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
*.py[co] | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
lib | ||
lib64 | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
nosetests.xml | ||
|
||
# IDEs | ||
.idea | ||
.project | ||
.pydevproject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright (c) 2014, Remi Rampin | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software | ||
without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include README.rst | ||
include LICENSE.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Gitify | ||
====== | ||
|
||
TODO : doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = '0.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
"""Entry point for the gitify utility. | ||
This contains :func:`~gitify.main.main`, which is the entry point declared to | ||
setuptools. It is also callable directly. | ||
""" | ||
|
||
from __future__ import unicode_literals | ||
|
||
import argparse | ||
import codecs | ||
import locale | ||
import logging | ||
import sys | ||
|
||
from . import __version__ as gitify_version | ||
|
||
|
||
def setup_logging(verbosity): | ||
levels = [logging.CRITICAL, logging.WARNING, logging.INFO, logging.DEBUG] | ||
level = levels[min(verbosity, 3)] | ||
|
||
fmt = "%(asctime)s %(levelname)s: %(message)s" | ||
formatter = logging.Formatter(fmt) | ||
|
||
handler = logging.StreamHandler() | ||
handler.setFormatter(formatter) | ||
|
||
logger = logging.getLogger() | ||
logger.setLevel(level) | ||
logger.addHandler(handler) | ||
|
||
|
||
def main(): | ||
"""Entry point when called on the command line. | ||
""" | ||
# Locale | ||
locale.setlocale(locale.LC_ALL, '') | ||
|
||
# Encoding for output streams | ||
if str == bytes: # PY2 | ||
writer = codecs.getwriter(locale.getpreferredencoding()) | ||
sys.stdout = writer(sys.stdout) | ||
sys.stderr = writer(sys.stderr) | ||
|
||
# Parses command-line | ||
|
||
# General options | ||
options = argparse.ArgumentParser(add_help=False) | ||
options.add_argument('--version', action='version', | ||
version="gitify version %s" % gitify_version) | ||
options.add_argument('-v', '--verbose', action='count', default=1, | ||
dest='verbosity', | ||
help="augments verbosity level") | ||
|
||
parser = argparse.ArgumentParser( | ||
description="gitify synchronizes a directory with a Git " | ||
"repository; it is particularly useful to make a Git " | ||
"branch out of changes happening in DropBox or " | ||
"similar \"dump\" collaboration software", | ||
parents=[options]) | ||
|
||
args = parser.parse_args() | ||
setup_logging(args.verbosity) | ||
|
||
# TODO : do stuff | ||
|
||
sys.exit(0) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import os | ||
from setuptools import setup | ||
import sys | ||
|
||
|
||
# pip workaround | ||
os.chdir(os.path.abspath(os.path.dirname(__file__))) | ||
|
||
|
||
with open('README.rst') as fp: | ||
description = fp.read() | ||
req = [] | ||
if sys.version_info < (2, 7): | ||
req.append('argparse') | ||
setup(name='gitify', | ||
version='0.1', | ||
packages=['gitify'], | ||
entry_points={'console_scripts': [ | ||
'gitify = gitify.main:main']}, | ||
install_requires=req, | ||
description= | ||
"Synchronizes a directory with a Git repository; particularly " | ||
"useful to track \"dumb\" collaboration software like DropBox", | ||
author="Remi Rampin", | ||
author_email='[email protected]', | ||
maintainer="Remi Rampin", | ||
maintainer_email='[email protected]', | ||
url='https://github.com/remram44/gitify', | ||
long_description=description, | ||
license='BSD', | ||
keywords=['git', 'dropbox', 'drive', 'gdrive', 'cloud', 'dumb', 'sync', | ||
'synchronization', 'collaboration'], | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'License :: OSI Approved :: BSD License']) |