Browse Source

Use console_scripts instead of scripts to make it work on Win

Kentaro Wada 7 years ago
parent
commit
e86968cd3e
5 changed files with 17 additions and 11 deletions
  1. 5 0
      labelme/cli/__init__.py
  2. 0 0
      labelme/cli/draw_json.py
  3. 4 5
      labelme/cli/json_to_dataset.py
  4. 0 0
      labelme/cli/on_docker.py
  5. 8 6
      setup.py

+ 5 - 0
labelme/cli/__init__.py

@@ -0,0 +1,5 @@
+#!/usr/bin/env python
+
+from . import draw_json
+from . import json_to_dataset
+from . import on_docker

+ 0 - 0
scripts/labelme_draw_json → labelme/cli/draw_json.py


+ 4 - 5
scripts/labelme_json_to_dataset → labelme/cli/json_to_dataset.py

@@ -13,12 +13,11 @@ import yaml
 from labelme import utils
 
 
-warnings.warn("This script is aimed to demonstrate how to convert the\n"
-              "JSON file to a single image dataset, and not to handle\n"
-              "multiple JSON files to generate a real-use dataset.")
-
-
 def main():
+    warnings.warn("This script is aimed to demonstrate how to convert the\n"
+                "JSON file to a single image dataset, and not to handle\n"
+                "multiple JSON files to generate a real-use dataset.")
+
     parser = argparse.ArgumentParser()
     parser.add_argument('json_file')
     parser.add_argument('-o', '--out', default=None)

+ 0 - 0
scripts/labelme_on_docker → labelme/cli/on_docker.py


+ 8 - 6
setup.py

@@ -109,10 +109,12 @@ setup(
         'Topic :: Internet :: WWW/HTTP',
     ],
     package_data={'labelme': ['icons/*', 'resources.qrc']},
-    entry_points={'console_scripts': ['labelme=labelme.app:main']},
-    scripts=[
-        'scripts/labelme_draw_json',
-        'scripts/labelme_json_to_dataset',
-        'scripts/labelme_on_docker',
-    ],
+    entry_points={
+        'console_scripts': [
+            'labelme=labelme.app:main',
+            'labelme_draw_json=labelme.cli.draw_json:main',
+            'labelme_json_to_dataset=labelme.cli.json_to_dataset:main',
+            'labelme_on_docker=labelme.cli.on_docker:main',
+        ],
+    },
 )