Skip to content

Commit 41bf192

Browse files
committed
include __main__.py
1 parent 3279650 commit 41bf192

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Run DIF GUI
2222
-----------
2323

2424
```
25-
python -m dataintegrityfingerprint.gui
25+
python -m dataintegrityfingerprint -G
2626
```
2727

2828
or if installed via pip:
@@ -36,13 +36,13 @@ DIF Command line interface
3636
--------------------------
3737

3838
```
39-
python -m dataintegrityfingerprint.cli
39+
python -m dataintegrityfingerprint
4040
```
4141

4242
or if installed via pip:
4343

4444
```
45-
dataintegrityfingerprint.cli
45+
dataintegrityfingerprint
4646
```
4747

4848
DIF Python library

dataintegrityfingerprint/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__author__ = 'Oliver Lindemann <oliver@expyriment.org>, ' \
22
'Florian Krause <florian@expyriment.org>'
33

4-
__version__ = '0.6.0'
4+
__version__ = '0.6.1'
55

66
from sys import version_info as _vi
77
if _vi.major< 3:

dataintegrityfingerprint/__main__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .cli import cli
2+
3+
def run():
4+
cli()
5+
6+
if __name__ == "__main__":
7+
run()

dataintegrityfingerprint/cli.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from . import __version__
77

88

9-
def run():
9+
def cli():
1010

1111
def progress(count, total, status=''):
1212
bar_len = 50
@@ -74,6 +74,7 @@ def progress(count, total, status=''):
7474
"(Not suggested, please read documentation " +
7575
"carefully!)",
7676
default=False)
77+
7778
args = vars(parser.parse_args())
7879

7980
if args['listalgos']:
@@ -92,7 +93,7 @@ def progress(count, total, status=''):
9293
sys.exit()
9394

9495
if args["PATH"] is None:
95-
print("Use -h for help")
96+
print("Use -G to launch the GUI interface or -h for help.")
9697
sys.exit()
9798

9899
dif = DataIntegrityFingerprint(
@@ -135,8 +136,4 @@ def progress(count, total, status=''):
135136
print("Folder: {0}".format(dif.data))
136137
print("Files: {0} included".format(dif.count_files()))
137138
print("Algorithm: {0}".format(dif.hash_algorithm))
138-
print("DIF: {}".format(dif))
139-
140-
141-
if __name__ == "__main__":
142-
run()
139+
print("DIF: {}".format(dif))

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@
99
from sys import version_info as _vi
1010

1111
package_name = "dataintegrityfingerprint"
12+
application_name = package_name
1213

1314
install_requires = []
1415

16+
entry_points = {'console_scripts':
17+
['{}={}.__main__:run'.format(application_name, package_name)]}
18+
1519
if _vi.major< 1:
1620
raise RuntimeError("{0} requires Python 3 or larger.".format(package_name))
1721

@@ -49,9 +53,7 @@ def get_version(package):
4953
include_package_data=True,
5054
setup_requires=[],
5155
install_requires=install_requires,
52-
entry_points={
53-
'console_scripts': ['dataintegrityfingerprint={0}.cli:run'.format(package_name)],
54-
},
56+
entry_points=entry_points,
5557
keywords = "", #ToDo
5658
classifiers=[ #ToDO
5759
"Intended Audience :: Education",

0 commit comments

Comments
 (0)