Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kevin Lyda
chkcrontab
Commits
7a29880b
Commit
7a29880b
authored
Jan 04, 2017
by
Kevin Lyda
💬
Browse files
Add version info.
parent
ce2732ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
chkcrontab
View file @
7a29880b
...
...
@@ -31,23 +31,31 @@ import chkcrontab_lib as check
from
optparse
import
OptionParser
from
argparse
import
ArgumentParser
try
:
from
_version
import
__version__
except
ImportError
:
__version__
=
'unknown'
def
main
(
argv
):
"""main program."""
parser
=
ArgumentParser
(
description
=
"Parse crontab files and check each type of line for potential syntax errors."
)
description
=
'Parse crontab files; check for potential syntax errors.'
,
version
=
__version__
)
parser
.
add_argument
(
'crontab'
,
help
=
'the crontab file to parse'
)
parser
.
add_argument
(
'-w'
,
'--whitelist'
,
action
=
'append'
,
dest
=
'whitelisted_users'
,
help
=
'
A
user to ignore when warning of unrecognized users
This argument
may be passed multiple times
.
'
,
help
=
'user to ignore when warning of unrecognized users
;
may be passed multiple times'
,
default
=
[
'postgres'
,
'buildbot'
])
parser
.
add_argument
(
'-n'
,
'--no-check-passwd'
,
action
=
'store_false'
,
dest
=
'check_passwd'
,
help
=
'
D
isable user lookup'
)
dest
=
'check_passwd'
,
help
=
'
d
isable user lookup'
)
parser
.
add_argument
(
'-q'
,
'--quiet'
,
action
=
'store_true'
,
dest
=
'quiet'
,
help
=
"B
e quiet
"
)
dest
=
'quiet'
,
help
=
'b
e quiet
'
)
args
=
parser
.
parse_args
()
log
=
check
.
LogCounter
()
if
args
.
version
:
print
(
'Version %s
\n
'
%
__version__
)
return
0
if
not
args
.
quiet
:
print
(
'Checking correctness of %s'
%
args
.
crontab
)
return
check
.
check_crontab
(
args
,
log
)
...
...
setup.py
View file @
7a29880b
...
...
@@ -26,9 +26,9 @@ from distutils.command.install import install
from
distutils.core
import
setup
from
distutils.core
import
Command
BASE_DIR
=
os
.
path
.
dirname
(
globals
().
get
(
'__file__'
,
os
.
getcwd
()))
VERSION
=
os
.
popen2
(
'git describe --dirty="*" --always'
)[
1
].
readline
().
strip
()
open
(
'_version.py'
,
'w'
).
write
(
'__version__ = "%s"
\n
'
%
VERSION
)
class
TestCmd
(
Command
):
description
=
'Runs all available tests.'
...
...
@@ -171,13 +171,13 @@ if 'setuptools' not in dir():
setup
(
cmdclass
=
cmdclass
,
name
=
'chkcrontab'
,
version
=
'1.7'
,
version
=
VERSION
,
url
=
'http://code.google.com/p/chkcrontab'
,
author
=
'Kevin Lyda'
,
author_email
=
'lyda@google.com'
,
description
=
'A tool to detect crontab errors'
,
long_description
=
open
(
'README.rst'
).
read
(),
py_modules
=
[
'chkcrontab_lib'
],
py_modules
=
[
'chkcrontab_lib'
,
'.version'
],
scripts
=
[
'chkcrontab'
],
keywords
=
'check lint crontab'
,
# See http://pypi.python.org/pypi?%3Aaction=list_classifiers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment