-
Notifications
You must be signed in to change notification settings - Fork 0
/
ying
executable file
·44 lines (42 loc) · 1.34 KB
/
ying
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/local/bin/python2.7
# -*- coding: utf8 -*-
import os
import shutil
import Util
import DubboSer
import Actions
#入口
def welcome():
print '欢迎使用 YingTool,源码在/usr/local/tool/下,使用CTRL-C退出程序'
#调用获取服务函数
rootdir=r'/app/'
u = Util.Util()
d = u.server_dic(rootdir)
#显示列表开始
print '下面是'+rootdir+'下的所有服务:'
print '┏┈'+'┈'*48+'┈┓'
print '┃= 序号 =┃= 服务路径 =┃'
for k in sorted(d.keys()):
print '┃='+' '*3+str(k)+' '*(8-len(str(k)))+'=│='+' '*4+rootdir+d[k]+' '*(30-len(d[k])-len(rootdir))+'=┃'
print '┃= d =┃= 操作dubbo服务 =┃'
print '┗┈'+'┈'*48+'┈┛'
#显示列表结束
try:
num = raw_input('\n请输入对应的序号选择服务,选择d可选择dubbo服务: ')
#判断是否为dubbo服务
if num.lower() == 'd':
d = DubboSer.DubboSer()
d.dubboServer()
elif int(num) in sorted(d.keys()):
a = Actions.Actions()
a.actions(int(num),rootdir,d)
else:
print '\n输入的服务不存在,请重新输入!!!\n'
welcome()
except KeyboardInterrupt:
print '\nyingTool程序终止\n'
except KeyError and ValueError:
print '\n输入的服务不存在,请重新输入!!!\n'
welcome()
if __name__ == '__main__':
welcome()