Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
zendata
提交
559b4cb3
Z
zendata
项目概览
LinuxSuRen
/
zendata
与 Fork 源项目一致
Fork自
易企天创 / zendata
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
559b4cb3
编写于
8月 24, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
close task#7619,7620
上级
389500c7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
89 addition
and
8 deletion
+89
-8
demo/advanced.yaml
demo/advanced.yaml
+1
-1
demo/test/test.yaml
demo/test/test.yaml
+15
-0
res/en/messages.json
res/en/messages.json
+4
-0
res/zh/messages.json
res/zh/messages.json
+4
-0
src/utils/file/file.go
src/utils/file/file.go
+19
-7
yaml/base/name/numbers.v1.yaml
yaml/base/name/numbers.v1.yaml
+46
-0
未找到文件。
demo/advanced.yaml
浏览文件 @
559b4cb3
...
@@ -43,7 +43,7 @@ fields:
...
@@ -43,7 +43,7 @@ fields:
use
:
large{3}
use
:
large{3}
-
field
:
field_use_yaml
-
field
:
field_use_yaml
range
:
9-7,test/nested1.yaml{5}
range
:
测试,测,
9-7,test/nested1.yaml{5}
# rand: true
# rand: true
prefix
:
"
***"
prefix
:
"
***"
postfix
:
"
***
\t
"
postfix
:
"
***
\t
"
...
...
demo/test/test.yaml
0 → 100644
浏览文件 @
559b4cb3
title
:
测试文件
desc
:
author
:
zentao
version
:
1.0
fields
:
-
field
:
test1
from
:
base.name.letters.v1.yaml
use
:
letters
postfix
:
"
\t
"
-
field
:
test2
from
:
base.name.numbers.v1.yaml
use
:
numbers
postfix
:
"
\t
"
\ No newline at end of file
res/en/messages.json
浏览文件 @
559b4cb3
...
@@ -71,6 +71,10 @@
...
@@ -71,6 +71,10 @@
"id"
:
"fail_to_parse_ranges"
,
"id"
:
"fail_to_parse_ranges"
,
"translation"
:
"%s is not ResRanges format, try to parse as ResInsts."
"translation"
:
"%s is not ResRanges format, try to parse as ResInsts."
},
},
{
"id"
:
"fail_to_find_res"
,
"translation"
:
"Fail to load resource from %s."
},
{
{
"id"
:
"generate_records"
,
"id"
:
"generate_records"
,
...
...
res/zh/messages.json
浏览文件 @
559b4cb3
...
@@ -66,6 +66,10 @@
...
@@ -66,6 +66,10 @@
"id"
:
"fail_to_parse_ranges"
,
"id"
:
"fail_to_parse_ranges"
,
"translation"
:
"%s不是ResRanges格式,尝试解析为ResInsts对象。"
"translation"
:
"%s不是ResRanges格式,尝试解析为ResInsts对象。"
},
},
{
"id"
:
"fail_to_find_res"
,
"translation"
:
"加载资源%s失败."
},
{
{
"id"
:
"generate_records"
,
"id"
:
"generate_records"
,
...
...
src/utils/file/file.go
浏览文件 @
559b4cb3
...
@@ -4,7 +4,9 @@ import (
...
@@ -4,7 +4,9 @@ import (
"github.com/easysoft/zendata/res"
"github.com/easysoft/zendata/res"
commonUtils
"github.com/easysoft/zendata/src/utils/common"
commonUtils
"github.com/easysoft/zendata/src/utils/common"
constant
"github.com/easysoft/zendata/src/utils/const"
constant
"github.com/easysoft/zendata/src/utils/const"
i118Utils
"github.com/easysoft/zendata/src/utils/i118"
"github.com/easysoft/zendata/src/utils/vari"
"github.com/easysoft/zendata/src/utils/vari"
"github.com/fatih/color"
"io/ioutil"
"io/ioutil"
"os"
"os"
"os/exec"
"os/exec"
...
@@ -188,14 +190,15 @@ func ConvertResYamlPath(from string) (ret string) {
...
@@ -188,14 +190,15 @@ func ConvertResYamlPath(from string) (ret string) {
}
}
file
:=
strings
.
Join
(
arr
[
i
:
],
"."
)
file
:=
strings
.
Join
(
arr
[
i
:
],
"."
)
relatPath
:=
""
if
dir
!=
""
{
if
dir
!=
""
{
re
t
=
dir
+
constant
.
PthSep
+
file
re
latPath
=
dir
+
constant
.
PthSep
+
file
}
else
{
}
else
{
re
t
=
file
re
latPath
=
file
}
}
realPth1
:=
vari
.
WorkDir
+
constant
.
ResDirYaml
+
constant
.
PthSep
+
re
t
realPth1
:=
vari
.
WorkDir
+
constant
.
ResDirYaml
+
constant
.
PthSep
+
re
latPath
realPth2
:=
vari
.
WorkDir
+
constant
.
ResDirUsers
+
constant
.
PthSep
+
re
t
realPth2
:=
vari
.
WorkDir
+
constant
.
ResDirUsers
+
constant
.
PthSep
+
re
latPath
if
FileExist
(
realPth1
)
{
if
FileExist
(
realPth1
)
{
ret
=
realPth1
ret
=
realPth1
break
break
...
@@ -205,6 +208,10 @@ func ConvertResYamlPath(from string) (ret string) {
...
@@ -205,6 +208,10 @@ func ConvertResYamlPath(from string) (ret string) {
}
}
}
}
if
ret
==
""
{
color
.
New
(
color
.
FgCyan
)
.
Fprintf
(
color
.
Output
,
i118Utils
.
I118Prt
.
Sprintf
(
"fail_to_find_res"
,
from
)
+
"
\n
"
)
}
return
return
}
}
...
@@ -224,13 +231,14 @@ func convertResExcelPath(from string) (ret, sheet string) {
...
@@ -224,13 +231,14 @@ func convertResExcelPath(from string) (ret, sheet string) {
}
}
file
:=
strings
.
Join
(
arr
[
i
:
],
"."
)
+
".xlsx"
file
:=
strings
.
Join
(
arr
[
i
:
],
"."
)
+
".xlsx"
relatPath
:=
""
if
dir
!=
""
{
if
dir
!=
""
{
re
t
=
dir
+
constant
.
PthSep
+
file
re
latPath
=
dir
+
constant
.
PthSep
+
file
}
else
{
}
else
{
re
t
=
file
re
latPath
=
file
}
}
realPth
:=
vari
.
WorkDir
+
constant
.
ResDirData
+
constant
.
PthSep
+
re
t
realPth
:=
vari
.
WorkDir
+
constant
.
ResDirData
+
constant
.
PthSep
+
re
latPath
if
FileExist
(
realPth
)
{
if
FileExist
(
realPth
)
{
if
index
==
1
{
if
index
==
1
{
sheet
=
from
[
strings
.
LastIndex
(
from
,
"."
)
+
1
:
]
sheet
=
from
[
strings
.
LastIndex
(
from
,
"."
)
+
1
:
]
...
@@ -241,5 +249,9 @@ func convertResExcelPath(from string) (ret, sheet string) {
...
@@ -241,5 +249,9 @@ func convertResExcelPath(from string) (ret, sheet string) {
}
}
}
}
if
ret
==
""
{
color
.
New
(
color
.
FgCyan
)
.
Fprintf
(
color
.
Output
,
i118Utils
.
I118Prt
.
Sprintf
(
"fail_to_find_res"
,
from
)
+
"
\n
"
)
}
return
return
}
}
\ No newline at end of file
yaml/base/name/numbers.v1.yaml
0 → 100644
浏览文件 @
559b4cb3
title
:
数字账号
desc
:
author
:
zentao
version
:
1.0
field
:
account_numbers
instances
:
-
instance
:
1_number
note
:
单个数字
prefix
:
fields
:
-
field
:
part1
range
:
0-9
-
instance
:
2_numbers
note
:
两个数字
prefix
:
fields
:
-
field
:
part1
range
:
0-9
loop
:
2
-
instance
:
3_numbers
note
:
三个数字
prefix
:
fields
:
-
field
:
part1
range
:
0-9
loop
:
3
-
instance
:
4_numbers
note
:
四个数字
prefix
:
fields
:
-
field
:
part1
range
:
0-9
loop
:
4
-
instance
:
numbers
note
:
多个数字
prefix
:
fields
:
-
field
:
part1
range
:
0-9
loop
:
5-100
rand
:
true
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录