Skip to content

Commit

Permalink
Added code for packaging the stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Terje Sandstrom committed Dec 4, 2019
1 parent 075fc3d commit 2e13d75
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 11 deletions.
113 changes: 113 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,116 @@ healthchecksdb
MigrationBackup/

# End of https://www.gitignore.io/api/visualstudio

## Python ignores

# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# End of https://www.gitignore.io/api/python

3 changes: 3 additions & 0 deletions __main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import listgits

listgits.main()
26 changes: 15 additions & 11 deletions listgits.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,23 @@ def listgits(cwd,level,s,local,remotes):
listgits(root,level,s,local,remotes)
os.chdir(root)

parser = argparse.ArgumentParser()
parser.add_argument("--s",action="store_true",help="Output results in short form, ignoring non-git folders")
parser.add_argument("--l",action="store_true",help="Show only local repos")
parser.add_argument("--r",action="store_true",help="Show only repos with remotes")
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--s",action="store_true",help="Output results in short form, ignoring non-git folders")
parser.add_argument("--l",action="store_true",help="Show only local repos")
parser.add_argument("--r",action="store_true",help="Show only repos with remotes")

args = parser.parse_args()
args = parser.parse_args()

short = args.s
local = args.l
remotes = args.r
if not short and (local or remotes):
short=True
short = args.s
local = args.l
remotes = args.r
if not short and (local or remotes):
short=True


listgits('./',0,short,local,remotes)
listgits('./',0,short,local,remotes)

if __name__ == "__main__":
main()

6 changes: 6 additions & 0 deletions listgits_pkg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from listgits import listgits

def main():
listgits.main()


22 changes: 22 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="listgits-pkg-osirsiterje",
version="0.3.1",
author="Terje Sandstrom",
author_email="[email protected]",
description="Python command line program for listing all git repositories under a folder root",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/OsirisTerje/listgits",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
)

0 comments on commit 2e13d75

Please sign in to comment.