Browse Source

Install /usr/bin/ launcher as requested by Patrick Kuijvenhoven in (https://github.com/ercpe/smart-check/issues/2).

tags/0.3.1
Johann Schmitz 2 years ago
parent
commit
e7d5bb3bc2
2 changed files with 11 additions and 2 deletions
  1. 6
    1
      setup.py
  2. 5
    1
      smartcheck/__main__.py

+ 6
- 1
setup.py View File

@@ -15,7 +15,12 @@ setup(
15 15
     download_url='https://code.not-your-server.de/smart-check.git/tags/',
16 16
     packages=find_packages('.'),
17 17
     include_package_data=True,
18
-    package_data = {'': ['*.yaml']},
18
+    package_data={'': ['*.yaml']},
19 19
     zip_safe=False,
20 20
     license='GPL-3',
21
+    entry_points={
22
+        'console_scripts': [
23
+            'smart-check = smartcheck.__main__:main'
24
+        ]
25
+    },
21 26
 )

+ 5
- 1
smartcheck/__main__.py View File

@@ -30,7 +30,7 @@ def execute_smartctl(drive, interface=None, sudo=None, smartctl_path=None, smart
30 30
 #        raise Exception("smartctl failed with status code %s" % process.returncode)
31 31
     return output
32 32
 
33
-if __name__ == "__main__":
33
+def main():
34 34
     parser = ArgumentParser()
35 35
 
36 36
     parser.add_argument('--disks-file', default=DEFAULT_DISKS_FILE)
@@ -125,3 +125,7 @@ if __name__ == "__main__":
125 125
 
126 126
     print(msg)
127 127
     sys.exit(exit_code)
128
+
129
+
130
+if __name__ == "__main__":
131
+    main()

Loading…
Cancel
Save