Skip to content

Commit

Permalink
Initial structure
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Sep 29, 2014
0 parents commit 51cb3c2
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .gitignore
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
26 changes: 26 additions & 0 deletions LICENSE.txt
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.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.rst
include LICENSE.txt
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Gitify
======

TODO : doc
1 change: 1 addition & 0 deletions gitify/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.1'
71 changes: 71 additions & 0 deletions gitify/main.py
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()
35 changes: 35 additions & 0 deletions setup.py
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'])

0 comments on commit 51cb3c2

Please sign in to comment.