mirror of
https://github.com/oskar456/dzonegit.git
synced 2024-05-11 05:55:41 +00:00
Add setup.py
This commit is contained in:
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Ondřej Caletka
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
12
dzonegit.py
12
dzonegit.py
@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import re
|
||||
from collections import namedtuple
|
||||
@ -172,7 +173,7 @@ def check_updated_zones(against):
|
||||
pass # Old version of zone did not exist
|
||||
|
||||
|
||||
def main():
|
||||
def pre_commit():
|
||||
against = get_head()
|
||||
try:
|
||||
check_whitespace_errors(against)
|
||||
@ -182,5 +183,14 @@ def main():
|
||||
raise SystemExit(1)
|
||||
|
||||
|
||||
def main():
|
||||
name = Path(sys.argv[0]).name
|
||||
print(name)
|
||||
if name == "pre-commit":
|
||||
pre_commit()
|
||||
else:
|
||||
sys.exit("No valid command found")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
19
setup.py
Normal file
19
setup.py
Normal file
@ -0,0 +1,19 @@
|
||||
from setuptools import setup
|
||||
|
||||
|
||||
setup(
|
||||
name="dzonegit",
|
||||
version="0.1",
|
||||
description="Git hooks to admin DNS zone files in git",
|
||||
author="Ondřej Caletka",
|
||||
author_email="ondrej@caletka.cz",
|
||||
license="MIT",
|
||||
py_modules=["dzonegit"],
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"dzonegit = dzonegit:main",
|
||||
"pre-commit = dzonegit:pre_commit",
|
||||
],
|
||||
},
|
||||
)
|
||||
|
Reference in New Issue
Block a user