Compare commits

...

2 Commits
main ... gui

Author SHA1 Message Date
Alexander Popov 12ae5caaa9 add tox && use black and pylint 2021-07-21 23:58:08 +03:00
Alexander Popov 527311df59 update usage 2021-07-21 23:40:40 +03:00
7 changed files with 25 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
venv/
.tox/
dist/
assm/__pycache__
images/

2
.pylintrc Normal file
View File

@ -0,0 +1,2 @@
[BASIC]
good-names = e

View File

@ -1,13 +1,14 @@
## Apple Splash Screen Maker
# Apple Splash Screen Maker
![](https://img.shields.io/pypi/v/assm?style=for-the-badge) ![](https://img.shields.io/pypi/l/assm?style=for-the-badge) ![](https://img.shields.io/github/languages/code-size/emilecok/assm?style=for-the-badge)
## Usage and Examples
Install package
1. Install package
``` sh
pip install assm
```
2. Place `logo.png` and run script in this directory
Usage
``` sh
python3 -m assm

View File

@ -1,5 +1,6 @@
"""iOS splash screen generator"""
import sys
import os
from PIL import Image
from assm.devices import APPLE_DEVICES
@ -19,14 +20,14 @@ def make_splash_image(screen_orientation, screen_width, screen_height, logo_path
splash_image = Image.new('RGB', (screen_width, screen_height), (255, 255, 255))
logo_image = Image.open(logo_path)
app_logo = logo_image.resize((logo_size, logo_size))
try:
splash_image.paste(app_logo, (logo_w_pos, logo_h_pos), app_logo)
except ValueError as e:
if str(e) == 'bad transparency mask':
print('ERROR: Bad transparency mask.')
quit(-1)
sys.exit(-1)
return splash_image
@ -51,9 +52,9 @@ def main(output_folder='./images/'):
try:
splash = make_splash_image('portrait', device_w, device_h, 'logo.png')
except FileNotFoundError as e:
except FileNotFoundError:
print('ERROR: File logo.png not found.')
quit(1)
sys.exit(1)
splash.save(file_name)
print('...splash for {w}x{h} saved...'.format(w=device_w, h=device_h))

View File

@ -1,3 +1,4 @@
black==20.8b1
flit==3.0.0
pylint==2.7.1
tox==3.24.0

View File

@ -7,7 +7,7 @@ module = "assm"
author = "Alexander Popov"
author-email = "iiiypuk@iiiypuk.me"
home-page = "https://github.com/emilecok/assm"
requires = ["Pillow==8.3.1" ]
requires = [ "Pillow==8.3.1" ]
description-file = "README.md"
classifiers = [
"License :: OSI Approved :: MIT License",

12
tox.ini Normal file
View File

@ -0,0 +1,12 @@
[tox]
isolated_build = True
envlist = py36,py37,py38,py39
[testenv]
deps =
black
pylint
pytest
commands =
black assm --skip-string-normalization
pylint assm