Skip to content

Commit 162d0d8

Browse files
author
Alan Braithwaite
committed
Setup python packaging
1 parent 526218a commit 162d0d8

File tree

7 files changed

+41
-5
lines changed

7 files changed

+41
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.pyc
33
.coverage*
44
htmlcov
5+
dist

MANIFEST

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# file GENERATED by distutils, do NOT edit
2+
LICENSE
3+
README.md
4+
setup.py
5+
bin/git-fat
6+
git_fat/__init__.py
7+
git_fat/git_fat.py

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include LICENSE
2+
include README.md

bin/git-fat

-1
This file was deleted.

bin/git-fat

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/python
2+
3+
from git_fat import main
4+
5+
if __name__ == '__main__':
6+
main()

git_fat/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__all__ = ['git_fat']
2+
3+
from git_fat import *

git_fat/git_fat.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def push(self, **kwargs):
547547
p = sub.Popen(rsync, stdin=sub.PIPE)
548548
p.communicate(input='\x00'.join(files))
549549

550-
def _status(self):
550+
def _status(self, **kwargs):
551551
catalog = self._cached_objects()
552552
referenced = self._referenced_objects(**kwargs)
553553
garbage = catalog - referenced
@@ -558,7 +558,7 @@ def status(self, **kwargs):
558558
'''
559559
Show orphan (in tree, but not in cache) and garbage (in cache, but not in tree) objects, if any.
560560
'''
561-
garbage, orphans = self._status()
561+
garbage, orphans = self._status(**kwargs)
562562
if orphans:
563563
print('Orphan objects:')
564564
for orph in orphans:
@@ -574,7 +574,7 @@ def http_pull(self, **kwargs):
574574
'''
575575
ret_code = 0
576576

577-
_, orphans = self._status()
577+
_, orphans = self._status(**kwargs)
578578
baseurl = self._http_opts()
579579
for o in orphans:
580580
stream = http_get(baseurl, o)
@@ -610,7 +610,8 @@ def http_push(self):
610610
''' NOT IMPLEMENTED '''
611611
pass
612612

613-
if __name__ == '__main__':
613+
614+
def main():
614615

615616
import argparse
616617

@@ -674,3 +675,7 @@ def http_push(self):
674675
if kwargs.get('cur_file'):
675676
fat.verbose("ERROR: processing file: " + kwargs.get('cur_file'))
676677
raise
678+
679+
680+
if __name__ == '__main__':
681+
main()

setup.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from distutils.core import setup
2+
3+
setup(
4+
name='git-fat',
5+
maintainer='Alan Braithwaite',
6+
maintainer_email='[email protected]',
7+
url='https://github.com/cyaninc/git-fat',
8+
version='0.1.0',
9+
packages=['git_fat'],
10+
scripts=['bin/git-fat'],
11+
license='BSD 2-Clause',
12+
long_description=open('README.md').read(),
13+
)

0 commit comments

Comments
 (0)