提交 f5146e72 编写于 作者: W wuzewu

update commands

上级 b25dfb58
......@@ -50,5 +50,10 @@ class HubCommand(BaseCommand):
command = HubCommand.instance()
def main():
command.exec(sys.argv[1:])
if __name__ == "__main__":
command.exec(sys.argv[1:])
......@@ -11,15 +11,16 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from paddle_hub.tools.logger import logger
from paddle_hub.commands.base_command import BaseCommand, ENTRY
from paddle_hub.tools import utils
from paddle_hub.module.manager import default_module_manager
import argparse
class InstallCommand(BaseCommand):
......@@ -28,7 +29,7 @@ class InstallCommand(BaseCommand):
def __init__(self, name):
super(InstallCommand, self).__init__(name)
self.show_in_help = True
self.description = "Install the specify module to current environment."
self.description = "Install the specific module to current environment."
self.parser = self.parser = argparse.ArgumentParser(
description=self.__class__.__doc__,
prog='%s %s <module_name>' % (ENTRY, name),
......
......@@ -15,6 +15,7 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from paddle_hub.tools.logger import logger
from paddle_hub.commands.base_command import BaseCommand
from paddle_hub.tools import utils
......@@ -28,7 +29,7 @@ class ListCommand(BaseCommand):
def __init__(self, name):
super(ListCommand, self).__init__(name)
self.show_in_help = True
self.description = "List all module install in current environment."
self.description = "List all modules install in current environment."
def exec(self, argv):
all_modules = default_module_manager.all_modules()
......
......@@ -34,7 +34,7 @@ class RunCommand(BaseCommand):
def __init__(self, name):
super(RunCommand, self).__init__(name)
self.show_in_help = True
self.description = "Run the specify module"
self.description = "Run the specific module."
self.parser = self.parser = argparse.ArgumentParser(
description=self.__class__.__doc__,
prog='%s %s <module>' % (ENTRY, name),
......
......@@ -15,12 +15,14 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import argparse
from paddle_hub.tools.logger import logger
from paddle_hub.commands.base_command import BaseCommand, ENTRY
from paddle_hub.module.manager import default_module_manager
from paddle_hub.module.module import Module
import os
import argparse
class ShowCommand(BaseCommand):
......@@ -29,7 +31,7 @@ class ShowCommand(BaseCommand):
def __init__(self, name):
super(ShowCommand, self).__init__(name)
self.show_in_help = True
self.description = "Show the specify module's info"
self.description = "Show the specify module's info."
self.parser = self.parser = argparse.ArgumentParser(
description=self.__class__.__doc__,
prog='%s %s <module_name/module_dir>' % (ENTRY, name),
......@@ -59,7 +61,6 @@ class ShowCommand(BaseCommand):
show_text += "Author:%s\n" % module.author
show_text += "Author-Email:%s\n" % module.author_email
show_text += "Location:%s\n" % module_dir
#TODO(wuzewu): add more signature info
print(show_text)
return True
......
......@@ -15,11 +15,13 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from paddle_hub.tools.logger import logger
from paddle_hub.commands.base_command import BaseCommand, ENTRY
from paddle_hub.tools import utils
from paddle_hub.module.manager import default_module_manager
import argparse
class UninstallCommand(BaseCommand):
......@@ -28,7 +30,7 @@ class UninstallCommand(BaseCommand):
def __init__(self, name):
super(UninstallCommand, self).__init__(name)
self.show_in_help = True
self.description = "Uninstall the specify module from current environment."
self.description = "Uninstall the specific module from current environment."
self.parser = self.parser = argparse.ArgumentParser(
description=self.__class__.__doc__,
prog='%s %s <module_name>' % (ENTRY, name),
......
......@@ -15,6 +15,7 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from paddle_hub.tools.logger import logger
from paddle_hub.commands.base_command import BaseCommand
from paddle_hub import version
......@@ -26,7 +27,7 @@ class VersionCommand(BaseCommand):
def __init__(self, name):
super(VersionCommand, self).__init__(name)
self.show_in_help = True
self.description = "Get the paddle hub version"
self.description = "Get the paddle hub version."
def exec(self, argv):
print("hub %s" % version.hub_version)
......
......@@ -18,24 +18,22 @@ from __future__ import print_function
from setuptools import find_packages
from setuptools import setup
from paddle_hub import __version__
from paddle_hub.version import hub_version
REQUIRED_PACKAGES = [
'numpy >= 1.12.0',
'six >= 1.10.0',
'protobuf >= 3.1.0',
'numpy >= 1.12.0', 'six >= 1.10.0', 'protobuf >= 3.1.0', 'pyyaml', 'numpy'
]
setup(
name='paddle_hub',
version=__version__.replace('-', ''),
version=hub_version.replace('-', ''),
description=('PaddleHub is a library to foster the publication, '
'discovery, and consumption of reusable parts of machine '
'learning models.'),
long_description='',
url='https://github.com/PaddlePaddle/PaddleHub',
author='PaddlePaddle Author',
author_email='chenzeyu01@baidu.com',
author_email='paddle-dev@baidu.com',
install_requires=REQUIRED_PACKAGES,
packages=find_packages(),
# PyPI package information.
......@@ -59,4 +57,4 @@ setup(
],
license='Apache 2.0',
keywords=('paddlepaddle pretrained paddle-hub'),
)
entry_points={'console_scripts': ['hub=paddle_hub.commands.hub:main']})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册