Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zentaoatf
提交
d2c5bd3c
Z
zentaoatf
项目概览
易企天创
/
zentaoatf
10 个月 前同步成功
通知
11
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zentaoatf
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d2c5bd3c
编写于
10月 10, 2019
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
color related update
上级
08d39c9a
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
22 addition
and
22 deletion
+22
-22
src/action/bug.go
src/action/bug.go
+3
-3
src/action/gen.go
src/action/gen.go
+2
-2
src/service/script/viewer.go
src/service/script/viewer.go
+2
-2
src/service/zentao/testcase.go
src/service/zentao/testcase.go
+1
-1
src/utils/config/config.go
src/utils/config/config.go
+3
-3
src/utils/lang/lang.go
src/utils/lang/lang.go
+1
-1
src/utils/log/print.go
src/utils/log/print.go
+3
-3
src/utils/stdin/stdin.go
src/utils/stdin/stdin.go
+7
-7
未找到文件。
src/action/bug.go
浏览文件 @
d2c5bd3c
...
...
@@ -37,8 +37,8 @@ func CommitBug(files []string) {
}
for
{
logUtils
.
PrintTo
StdOut
(
"
\n
"
+
i118Utils
.
I118Prt
.
Sprintf
(
"enter_case_id_for_report_bug"
),
color
.
FgCyan
)
logUtils
.
PrintTo
StdOut
(
strings
.
Join
(
lines
,
"
\n
"
),
-
1
)
logUtils
.
PrintTo
WithColor
(
"
\n
"
+
i118Utils
.
I118Prt
.
Sprintf
(
"enter_case_id_for_report_bug"
),
color
.
FgCyan
)
logUtils
.
PrintTo
WithColor
(
strings
.
Join
(
lines
,
"
\n
"
),
-
1
)
var
caseId
string
fmt
.
Scanln
(
&
caseId
)
...
...
@@ -50,7 +50,7 @@ func CommitBug(files []string) {
if
stringUtils
.
FindInArr
(
caseId
,
ids
)
{
page
.
CuiReportBug
(
resultDir
,
caseId
)
}
else
{
logUtils
.
PrintTo
StdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
"invalid_input"
),
color
.
FgRed
)
logUtils
.
PrintTo
WithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
"invalid_input"
),
color
.
FgRed
)
}
}
}
...
...
src/action/gen.go
浏览文件 @
d2c5bd3c
...
...
@@ -50,9 +50,9 @@ func Generate(productId string, moduleId string, suiteId string, taskId string,
if
err
==
nil
{
logUtils
.
PrintTo
(
i118Utils
.
I118Prt
.
Sprintf
(
"success_to_generate"
,
count
,
targetDir
)
+
"
\n
"
)
}
else
{
logUtils
.
PrintTo
StdOut
(
err
.
Error
(),
color
.
FgRed
)
logUtils
.
PrintTo
WithColor
(
err
.
Error
(),
color
.
FgRed
)
}
}
else
{
logUtils
.
PrintTo
StdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
"no_cases"
),
color
.
FgRed
)
logUtils
.
PrintTo
WithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
"no_cases"
),
color
.
FgRed
)
}
}
src/service/script/viewer.go
浏览文件 @
d2c5bd3c
...
...
@@ -108,11 +108,11 @@ func View(cases []string, keywords string) {
numb
:=
fmt
.
Sprintf
(
"#%0"
+
strconv
.
Itoa
(
width
)
+
"d"
,
idx
+
1
)
logUtils
.
PrintTo
(
logUtils
.
GetWholeLine
(
numb
+
" "
+
arr
[
3
],
"="
))
logUtils
.
PrintTo
StdOut
(
fmt
.
Sprintf
(
"%s. %s"
,
arr
[
0
],
arr
[
1
]),
color
.
FgCyan
)
logUtils
.
PrintTo
WithColor
(
fmt
.
Sprintf
(
"%s. %s"
,
arr
[
0
],
arr
[
1
]),
color
.
FgCyan
)
fmt
.
Printf
(
"Steps:
\n
%s
\n
"
,
arr
[
2
])
logUtils
.
PrintTo
StdOut
(
""
,
-
1
)
logUtils
.
PrintTo
WithColor
(
""
,
-
1
)
}
}
...
...
src/service/zentao/testcase.go
浏览文件 @
d2c5bd3c
...
...
@@ -225,7 +225,7 @@ func CommitCase(caseId int, title string, stepMap maps.Map, stepTypeMap maps.Map
"expects"
:
commonUtils
.
LinkedMapToMap
(
expectMap
)}
var
yes
bool
logUtils
.
PrintTo
StdOut
(
"
\n
"
+
i118Utils
.
I118Prt
.
Sprintf
(
"case_update_confirm"
,
caseId
,
title
),
-
1
)
logUtils
.
PrintTo
WithColor
(
"
\n
"
+
i118Utils
.
I118Prt
.
Sprintf
(
"case_update_confirm"
,
caseId
,
title
),
-
1
)
stdinUtils
.
InputForBool
(
&
yes
,
true
,
"want_to_continue"
)
if
yes
{
...
...
src/utils/config/config.go
浏览文件 @
d2c5bd3c
...
...
@@ -53,7 +53,7 @@ func SaveConfig(conf model.Config) error {
}
func
PrintCurrConfig
()
{
logUtils
.
PrintTo
StdOut
(
"
\n
"
+
i118Utils
.
I118Prt
.
Sprintf
(
"current_config"
),
color
.
FgCyan
)
logUtils
.
PrintTo
WithColor
(
"
\n
"
+
i118Utils
.
I118Prt
.
Sprintf
(
"current_config"
),
color
.
FgCyan
)
val
:=
reflect
.
ValueOf
(
vari
.
Config
)
typeOfS
:=
val
.
Type
()
...
...
@@ -117,7 +117,7 @@ func InputForSet() {
var
configSite
bool
logUtils
.
PrintTo
StdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
"begin_config"
),
color
.
FgCyan
)
logUtils
.
PrintTo
WithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
"begin_config"
),
color
.
FgCyan
)
enCheck
:=
""
var
numb
string
...
...
@@ -171,7 +171,7 @@ func CheckRequestConfig() {
func
InputForRequest
()
{
conf
:=
ReadCurrConfig
()
logUtils
.
PrintTo
StdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
"need_config"
),
color
.
FgCyan
)
logUtils
.
PrintTo
WithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
"need_config"
),
color
.
FgCyan
)
conf
.
Url
=
stdinUtils
.
GetInput
(
"(http://.*)"
,
conf
.
Url
,
"enter_url"
,
conf
.
Url
)
conf
.
Account
=
stdinUtils
.
GetInput
(
"(.{2,})"
,
conf
.
Account
,
"enter_account"
,
conf
.
Account
)
...
...
src/utils/lang/lang.go
浏览文件 @
d2c5bd3c
...
...
@@ -132,7 +132,7 @@ func GetSupportLanguageExtArr() []string {
func
CheckSupportLanguages
(
scriptLang
string
)
bool
{
if
LangMap
[
scriptLang
]
==
nil
{
langStr
:=
strings
.
Join
(
GetSupportLanguageArrSort
(),
", "
)
logUtils
.
PrintTo
StdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
"only_support_script_language"
,
langStr
)
+
"
\n
"
,
color
.
FgRed
)
logUtils
.
PrintTo
WithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
"only_support_script_language"
,
langStr
)
+
"
\n
"
,
color
.
FgRed
)
return
false
}
...
...
src/utils/log/print.go
浏览文件 @
d2c5bd3c
...
...
@@ -19,7 +19,7 @@ var (
)
func
PrintUsage
()
{
PrintTo
StdOut
(
"Usage: "
,
color
.
FgCyan
)
PrintTo
WithColor
(
"Usage: "
,
color
.
FgCyan
)
usage
:=
fileUtils
.
ReadResData
(
usageFile
)
exeFile
:=
"ztf"
...
...
@@ -29,7 +29,7 @@ func PrintUsage() {
usage
=
fmt
.
Sprintf
(
usage
,
exeFile
)
fmt
.
Printf
(
"%s
\n
"
,
usage
)
PrintTo
StdOut
(
"
\n
Example: "
,
color
.
FgCyan
)
PrintTo
WithColor
(
"
\n
Example: "
,
color
.
FgCyan
)
sample
:=
fileUtils
.
ReadResData
(
sampleFile
)
if
!
commonUtils
.
IsWin
()
{
regx
,
_
:=
regexp
.
Compile
(
`\\`
)
...
...
@@ -52,7 +52,7 @@ func PrintTo(str string) {
fmt
.
Fprint
(
output
,
str
+
"
\n
"
)
}
func
PrintTo
StdOut
(
msg
string
,
attr
color
.
Attribute
)
{
func
PrintTo
WithColor
(
msg
string
,
attr
color
.
Attribute
)
{
output
:=
color
.
Output
if
attr
==
-
1
{
...
...
src/utils/stdin/stdin.go
浏览文件 @
d2c5bd3c
...
...
@@ -104,11 +104,11 @@ func GetInput(regx string, defaultVal string, fmtStr string, params ...interface
msg
:=
i118Utils
.
I118Prt
.
Sprintf
(
fmtStr
,
params
...
)
for
{
logUtils
.
PrintTo
StdOut
(
"
\n
"
+
msg
,
color
.
FgCyan
)
logUtils
.
PrintTo
WithColor
(
"
\n
"
+
msg
,
color
.
FgCyan
)
// fmt.Scanln(&ret)
Scanf
(
&
ret
)
//logUtils.PrintTo
StdOut
(fmt.Sprintf("%v", ret), -1)
//logUtils.PrintTo
WithColor
(fmt.Sprintf("%v", ret), -1)
if
strings
.
TrimSpace
(
ret
)
==
""
&&
defaultVal
!=
""
{
ret
=
defaultVal
...
...
@@ -122,7 +122,7 @@ func GetInput(regx string, defaultVal string, fmtStr string, params ...interface
os
.
Exit
(
0
)
}
//logUtils.PrintTo
StdOut
(ret, -1)
//logUtils.PrintTo
WithColor
(ret, -1)
if
regx
==
""
{
return
ret
...
...
@@ -142,7 +142,7 @@ func GetInput(regx string, defaultVal string, fmtStr string, params ...interface
return
ret
}
else
{
ret
=
""
logUtils
.
PrintTo
StdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
msg
),
color
.
FgRed
)
logUtils
.
PrintTo
WithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
msg
),
color
.
FgRed
)
}
}
}
...
...
@@ -153,7 +153,7 @@ func GetInputForScriptInterpreter(defaultVal string, fmtStr string, params ...in
msg
:=
i118Utils
.
I118Prt
.
Sprintf
(
fmtStr
,
params
...
)
for
{
logUtils
.
PrintTo
StdOut
(
"
\n
"
+
msg
,
color
.
FgCyan
)
logUtils
.
PrintTo
WithColor
(
"
\n
"
+
msg
,
color
.
FgCyan
)
Scanf
(
&
ret
)
ret
=
strings
.
TrimSpace
(
ret
)
...
...
@@ -161,7 +161,7 @@ func GetInputForScriptInterpreter(defaultVal string, fmtStr string, params ...in
if
ret
==
""
&&
defaultVal
!=
""
{
ret
=
defaultVal
logUtils
.
PrintTo
StdOut
(
ret
,
-
1
)
logUtils
.
PrintTo
WithColor
(
ret
,
-
1
)
}
if
ret
==
"exit"
{
...
...
@@ -183,7 +183,7 @@ func GetInputForScriptInterpreter(defaultVal string, fmtStr string, params ...in
return
ret
}
else
{
ret
=
""
logUtils
.
PrintTo
StdOut
(
i118Utils
.
I118Prt
.
Sprintf
(
"invalid_input"
),
color
.
FgRed
)
logUtils
.
PrintTo
WithColor
(
i118Utils
.
I118Prt
.
Sprintf
(
"invalid_input"
),
color
.
FgRed
)
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录