Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
2553a234
Commit
2553a234
authored
Nov 18, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script
parent
d2e2c075
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
+15
-1
python/func.py
+14
-0
python/main.py
+1
-1
No files found.
python/func.py
View file @
2553a234
...
@@ -381,6 +381,20 @@ class Function:
...
@@ -381,6 +381,20 @@ class Function:
}
}
self
.
update_properties
(
config
,
lines
)
self
.
update_properties
(
config
,
lines
)
def
crop_logo
(
self
,
config
):
img_avg
=
Image
.
open
(
logo_path
)
logo_h
=
img_avg
.
size
[
1
]
*
(
512
/
img_avg
.
size
[
0
])
top_h
=
img_avg
.
size
[
1
]
*
(
1024
/
img_avg
.
size
[
0
])
img_logo
=
img_avg
.
resize
((
512
,
int
(
logo_h
)),
Image
.
ANTIALIAS
)
img_top
=
img_avg
.
resize
((
1024
,
int
(
top_h
)),
Image
.
ANTIALIAS
)
# 裁切图片
img_logo
=
img_logo
.
crop
((
0
,
(
logo_h
-
512
)
/
2
,
img_logo
.
size
[
0
],
512
+
(
logo_h
-
512
)
/
2
))
img_top
=
img_top
.
crop
((
0
,
(
top_h
-
500
)
/
2
,
img_top
.
size
[
0
],
500
+
(
top_h
-
500
)
/
2
))
img_logo
.
save
(
"
%
s/app/src/main/res/drawable-xxhdpi/logo_majia.png"
%
config
[
'root'
],
"PNG"
)
img_top
.
save
(
"
%
s/app/src/main/res/drawable-xxhdpi/top.png"
%
config
[
'root'
],
"PNG"
)
#copy logo
#copy logo
def
find_logo
(
self
,
config
):
def
find_logo
(
self
,
config
):
path
=
"/Users/connor/Downloads/
%
s"
%
config
[
'corp_id'
]
path
=
"/Users/connor/Downloads/
%
s"
%
config
[
'corp_id'
]
...
...
python/main.py
View file @
2553a234
...
@@ -180,7 +180,7 @@ elif command == 121:
...
@@ -180,7 +180,7 @@ elif command == 121:
Shell
()
.
install_app
(
config
)
Shell
()
.
install_app
(
config
)
elif
command
==
122
:
elif
command
==
122
:
Shell
()
.
install_app
(
config
)
Function
()
.
crop_logo
(
config
)
elif
command
==
123
:
elif
command
==
123
:
Function
()
.
find_logo
(
config
)
Function
()
.
find_logo
(
config
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment