没有项目描述

wcm的Python项目详细描述


WCM-Wings组件管理器

Build StatusPyPI versionPython 3.5DownloadsLicense

安装

pip install wcm

cli

wcmwings组件管理器是一个cli实用程序,用于publishdownloadwings组件到wings实例。

$ wcm --help
Usage: wcm [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --verbose
  --help         Show this message and exit.

Commands:
  configure  Configure credentials
  download   Download a component from the wings server.
  init       Initialize a directory for a new component.
  list       Lists all the components in the current wings instance
  publish    Deploy the pacakge to the wcm.
  version    Show wcm version.

configure子命令用于设置wcm用于与wings服务器交互的凭据。

$ wcm configure --help
Usage: wcm configure [OPTIONS]

  Configure credentials

Options:
  -p, --profile <profile-name>
  --help              Show this message and exit.

init子命令用于初始化文件系统上的新wings组件。

$ wcm init --help
Usage: wcm init [OPTIONS][COMPONENT]

  Initialize a directory for a new component.

Options:
  -y, --yes
  --help     Show this message and exit.

publish子命令将组件发布到wings服务器。

$ wcm publish --help
Usage: wcm publish [OPTIONS][COMPONENT]

  Deploy the pacakge to the wcm.

Options:
  -d, --debug / -nd, --no-debug
  -n, --dry-run
  --help                         Show this message and exit.

download子命令将从当前wings服务器下载组件。

$ wcm download --help
Usage: wcm download [OPTIONS] COMPONENT_ID
Download a component from wings server. Data stored in .yaml file and source code downloaded to folder within same directory. file-path can be specified to download into a specific directory

Options:
   -p, --profile <profile-name>
   -f, --file-path TEXT
   --help                        Show this message and exit.

list子命令列出当前Wings服务器中所有组件的名称

$ wcm list --help
Usage: wcm list [OPTIONS]
Lists all the components in the current wings instance

Options:
-p, --profile <profile-name>
--help                        Show this message and exit.

示例用法

一旦安装了wcm,请将您的凭据配置为使用wings服务器

C:\Users\Admin>wcm configure
WINGS Server URL: 
WINGS Export URL: http://localhost:8080
WINGS User: myUsername
WINGS Password:
WINGS Domain: wings-domain
Success 

现在您可以开始使用wcm了。首先列出您在凭据上指定的wings实例上的组件

C:\Users\Admin>wcm list
[Economic]
  └─┐
    ├─ economic-v6
    ├─ economictest-v5
    ├─ economicnodata-v6
    ├─ economic-different-data-v6
    └─ economicwcmtest 
                                                                                                                                                                                                                 
[Hydrological]
   └─┐                                                                                                                   
     ├─ HAND-1
     ├─ hand_final-v1
     ├─ hand-v1
     └─ handnodata-v1.0.1 

Done

接下来,您可以下载其中一个组件。让我们选择经济型V6。首先,您需要导航到要将组件下载到的目录。或者,也可以使用-f<;filepath>;参数指定要下载到的组件的文件路径

C:\Users\Admin\Desktop\down>ls

C:\Users\Admin\Desktop\down>wcm download economic-v5
2019-08-13 14:52:02,082 root         INFO     Downloading component
2019-08-13 14:52:02,226 root         INFO     Generated YAML 
2019-08-13 14:52:02,256 root         INFO     Download complete
Download complete  

C:\Users\Admin\Desktop\down>ls
economic-v6       

当你下载一个组件时,它有三个部分。存储组件数据的wings-component.yaml文件。存储排序代码的src文件夹。数据文件夹,目前只是一个占位符

下载economic-v5组件后,可以编辑一些源代码。要上载新版本(示例中为6.1),请使用publish命令

C:\Users\Admin\Desktop\down>ls
economic-v6.1

C:\Users\Admin\Desktop\down>wcm publish economic-v6.1
2019-08-13 15:04:08,540 root         INFO     Publishing component
Success                                                                                                                 

现在让我们检查list命令以确保它已发布

C:\Users\Admin\Desktop\down>wcm list
[Economic]
  └─┐
    ├─ economic-v6
    ├─ economictest-v5
    ├─ economicnodata-v6
    ├─ economic-different-data-v6
    ├─ economicwcmtest
    └─ economic-v6.1

[Hydrological]
  └─┐
    ├─ HAND-1
    ├─ hand_final-v1
    ├─ hand-v1
    └─ handnodata-v1.0.1

Done

现在,Economic-V6.1组件已上载到Wings

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java中最小长度的字数计算   java事务处理JavaEE 6   java如何进行5分钟刷新并检查txt是否被修改?   java可以同时拖动多个对象   变量长、双精度、字节、字符在Java中的用途是什么?   spring将XMLBean配置转换为java配置   java检测不可靠网络上的TCP丢失   Java:TCP加密、SSL和Netty   在java中,如何使用isAssignableFrom的映射避免多个if-else   在J2EE动态Web项目中找不到java CSS文件   java遍历领域查询到RealmList   安卓阅读网站内容Java   java如何修改/自定义/反编译Opera mini jar文件?   java死锁播放框架如何使用控制器中的参数检查@RestrictedResource?   java在MS Excel中导入xml文件我们如何使用Python或任何其他编程语言自动化此流程?   java如何暂停正在运行的线程并在需要时重新启动同一线程?