2022.03.24.1

emoji for color preview
This commit is contained in:
ульба 2022-03-24 15:00:27 +05:00
parent 1f4473e540
commit 176e55ffab
5 changed files with 147 additions and 121 deletions

View File

@ -24,6 +24,7 @@ __all__ = ALL_TEMPLATES + ["ALL_TEMPLATES"]
class DeviceColor(BaseModel):
color: str
path: str
emoji: str
class DeviceImage(BaseModel):
@ -107,7 +108,7 @@ def parse_config(path: str) -> Device:
kwargs['preview']: str = str(os.path.join(templates_path, path, 'preview.png'))
kwargs['colors'] = sorted([DeviceColor(
color=str(key).title(), path=str(os.path.join(templates_path, path, item))
color=str(key).title(), path=str(os.path.join(templates_path, path, item)), emoji=parse_emoji(str(key))
) for key, item in config['colors'].items()], key=lambda a: a.color)
kwargs['image'] = DeviceImage(
@ -125,3 +126,27 @@ def parse_config(path: str) -> Device:
)
return Device(**kwargs)
def parse_emoji(color: str):
if 'black' in color or 'graphite' in color or 'grey' \
in color or 'gray' in color or 'dark' in color or 'midnight' in color:
return '⬛️'
elif 'white' in color or 'silver' in color or 'light' in color or 'platinum' in color:
return '⬜️'
elif 'brown' in color:
return '🟫'
elif 'purple' in color or 'pink' in color:
return '🟪'
elif 'blue' in color:
return '🟦'
elif 'green' in color or 'coral' in color:
return '🟩'
elif 'yellow' in color or 'gold' in color:
return '🟨'
elif 'orange' in color:
return '🟧'
elif 'red' in color:
return '🟥'
else:
return '🔸'

View File

@ -42,10 +42,10 @@ def create_examples():
def create_readme():
mockup = MockupEngineerInstance()
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'readme-template.md'), 'r') as f:
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'readme-template.md'), 'r', encoding='utf8') as f:
data = Template(f.read()).render(templates=mockup.get_templates(), os=os, enumerate=enumerate)
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'readme.md'), 'w') as f:
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'readme.md'), 'w', encoding='utf8') as f:
f.write(data)
@ -70,14 +70,15 @@ def bump_version():
def run_pypi():
print(f'cd "{os.path.dirname(os.path.abspath(__file__))}"')
print('python setup.py sdist')
print('execute: twine upload dist/*')
print('twine upload dist/*')
input()
os.chdir(os.path.dirname(os.path.abspath(__file__)))
os.remove('dist')
os.remove('MockupEngineer.egg-info')
if __name__ == '__main__':
# create_readme()
create_readme()
# create_examples()
# bump_version()
bump_version()
run_pypi()

View File

@ -86,7 +86,7 @@ Full list of all currently supported mockups
### {{b.title}}
{% for c in b.templates %}
* [{{c.manufacturer}} {{c.name}}](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/{{os.path.basename(os.path.dirname(c.preview))}}/preview.png) ({{c.year}}) [{{c.resolution}}] - `{{c.id}}`
{% for d in c.colors %} * *{{d.color}}*
{% for d in c.colors %} * *{{d.color}}* {{d.emoji}}
{% endfor %}{% endfor %}{% endfor %}
You can help the project by adding support for new mockups by contributing on [GitHub](https://github.com/ulbwazhine/MockupEngineer).

226
readme.md
View File

@ -86,197 +86,197 @@ Full list of all currently supported mockups
### Phones
* [Samsung Galaxy S20](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/galaxys20/preview.png) (2020) [3200 x 1440] - `8080d01d4bdd37843088986938af2ae0`
* *Cloud Blue*
* *Cosmic Grey*
* *Pink*
* *Cloud Blue* 🟦
* *Cosmic Grey* ⬛️
* *Pink* 🟪
* [Samsung Galaxy S20 Ultra](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/galaxys20ultra/preview.png) (2020) [3200 x 1440] - `86fa8df7653bb8559cfc49b8670b16bc`
* *Cosmic Black*
* *Cosmic Grey*
* *Cosmic Black* ⬛️
* *Cosmic Grey* ⬛️
* [Apple iPhone 12](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphone12/preview.png) (2020) [2532 x 1170] - `3596ecc24abae25279feddb34dd72a0e`
* *Black*
* *Blue*
* *Green*
* *Product Red*
* *White*
* *Black* ⬛️
* *Blue* 🟦
* *Green* 🟩
* *Product Red* 🟥
* *White* ⬜️
* [Apple iPhone 12 Mini](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphone12mini/preview.png) (2020) [2340 x 1080] - `692048fda2b0b645f705066d522c12b8`
* *Black*
* *Blue*
* *Green*
* *Product Red*
* *White*
* *Black* ⬛️
* *Blue* 🟦
* *Green* 🟩
* *Product Red* 🟥
* *White* ⬜️
* [Apple iPhone 12 Pro](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphone12pro/preview.png) (2020) [2532 x 1170] - `753cf086117da37d8c2e44e974880a94`
* *Gold*
* *Graphite*
* *Pacific Blue*
* *Silver*
* *Gold* 🟨
* *Graphite* ⬛️
* *Pacific Blue* 🟦
* *Silver* ⬜️
* [Apple iPhone 12 Pro Max](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphone12promax/preview.png) (2020) [2778 x 1284] - `5509eab3ac4c47315753b2e50faeb633`
* *Gold*
* *Graphite*
* *Pacific Blue*
* *Silver*
* *Gold* 🟨
* *Graphite* ⬛️
* *Pacific Blue* 🟦
* *Silver* ⬜️
* [Apple iPhone 13](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphone13/preview.png) (2021) [2532 x 1170] - `33f683bda9f3beb5d0ce8ae5ef9e7fc4`
* *Blue*
* *Midnight*
* *Pink*
* *Product Red*
* *Starlight*
* *Blue* 🟦
* *Midnight* ⬛️
* *Pink* 🟪
* *Product Red* 🟥
* *Starlight* ⬜️
* [Apple iPhone 13 Mini](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphone13mini/preview.png) (2021) [2340 x 1080] - `09340db4628d41418a4ed472db07c60e`
* *Blue*
* *Midnight*
* *Pink*
* *Product Red*
* *Starlight*
* *Blue* 🟦
* *Midnight* ⬛️
* *Pink* 🟪
* *Product Red* 🟥
* *Starlight* ⬜️
* [Apple iPhone 13 Pro](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphone13pro/preview.png) (2021) [2532 x 1170] - `f0247d613f7d390cfb3362fd7242e515`
* *Gold*
* *Graphite*
* *Sierra Blue*
* *Silver*
* *Gold* 🟨
* *Graphite* ⬛️
* *Sierra Blue* 🟦
* *Silver* ⬜️
* [Apple iPhone 13 Pro Max](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphone13promax/preview.png) (2021) [2778 x 1284] - `d95345535d98fcc6f4030e1d3ca62052`
* *Gold*
* *Graphite*
* *Sierra Blue*
* *Silver*
* *Gold* 🟨
* *Graphite* ⬛️
* *Sierra Blue* 🟦
* *Silver* ⬜️
* [Apple iPhone SE](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphonese2020/preview.png) (2020) [1334 x 750] - `553673b4367e8ebf59067d764b45e9fd`
* *Black*
* *Product Red*
* *White*
* *Black* ⬛️
* *Product Red* 🟥
* *White* ⬜️
* [Apple iPhone Xr](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphonexr/preview.png) (2018) [1792 x 828] - `6ccede90e5879fd87f85cfb2039247b3`
* *Blue*
* *Coral*
* *Product Red*
* *Silver*
* *Space Gray*
* *Yellow*
* *Blue* 🟦
* *Coral* 🟩
* *Product Red* 🟥
* *Silver* ⬜️
* *Space Gray* ⬛️
* *Yellow* 🟨
* [Apple iPhone Xs](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphonexs/preview.png) (2019) [2436 x 1125] - `f4128697b9cb1963cc4d14727872fa44`
* *Gold*
* *Silver*
* *Space Gray*
* *Gold* 🟨
* *Silver* ⬜️
* *Space Gray* ⬛️
* [Apple iPhone Xs Max](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/iphonexsmax/preview.png) (2019) [2688 x 1242] - `16ebf01c894fb468c05a1b7c3e395d47`
* *Gold*
* *Silver*
* *Space Gray*
* *Gold* 🟨
* *Silver* ⬜️
* *Space Gray* ⬛️
* [Google Pixel](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/pixel/preview.png) (2016) [1920 x 1080] - `c7076ff96733f11e2cd8179fc2d5e7a4`
* *Quite Black*
* *Really Blue*
* *Very Silver*
* *Quite Black* ⬛️
* *Really Blue* 🟦
* *Very Silver* ⬜️
* [Google Pixel 4](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/pixel4/preview.png) (2019) [2280 x 1080] - `3bfff2be23c2c354403f5a622a804f64`
* *Just Black*
* *Clearly White*
* *Oh So Orange*
* *Clearly White* ⬜️
* *Just Black* ⬛️
* *Oh So Orange* 🟧
* [Google Pixel 4 XL](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/pixel4xl/preview.png) (2019) [3040 x 1440] - `7b0762b034f6c29f2c77a66bb388f59e`
* *Just Black*
* *Clearly White*
* *Oh So Orange*
* *Clearly White* ⬜️
* *Just Black* ⬛️
* *Oh So Orange* 🟧
* [Google Pixel 5](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/pixel5/preview.png) (2020) [2340 x 1080] - `2707894cc5d336d0ba276e6306e9f001`
* *Just Black*
* *Sorta Sage*
* *Just Black* ⬛️
* *Sorta Sage* 🔸
### Computers
* [Apple iMac 21"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/imac212015/preview.png) (2015) [4096 x 2304] - `71165ffd80a5db69ecd26e2e05ee1355`
* *Silver*
* *Silver* ⬜️
* [Apple iMac 24"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/imac242021/preview.png) (2021) [4480 x 2520] - `808f7bc509565fb4bdaab7c7b5485a68`
* *Green*
* *Yellow*
* *Orange*
* *Pink*
* *Purple*
* *Blue*
* *Silver*
* *Blue* 🟦
* *Green* 🟩
* *Orange* 🟧
* *Pink* 🟪
* *Purple* 🟪
* *Silver* ⬜️
* *Yellow* 🟨
* [Apple MacBook 12"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/macbook122016/preview.png) (2016) [2304 x 1440] - `4724b1349442f7fdaa60216d31cbd6a8`
* *Space Gray*
* *Gold*
* *Gold* 🟨
* *Space Gray* ⬛️
* [Apple MacBook Air (M1)](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/macbookair2020/preview.png) (2020) [2560 x 1600] - `d930de4882bee944ff19da75a4b6ee9f`
* *Silver*
* *Silver* ⬜️
* [Apple MacBook Pro 13"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/macbookpro132015/preview.png) (2015) [2560 x 1600] - `670487e7eaab6353af7f151f1da8622e`
* *Silver*
* *Silver* ⬜️
* [Apple MacBook Pro 15"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/macbookpro152015/preview.png) (2015) [2880 x 1800] - `4b33ac1e5b863a6b67f684d3e73a9796`
* *Silver*
* *Silver* ⬜️
* [Apple MacBook Pro 16"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/macbookpro162019/preview.png) (2019) [3072 x 1920] - `ce29763748dd896d6db09f94c626ca4d`
* *Space Gray*
* *Space Gray* ⬛️
* [Apple MacBook Pro 16"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/macbookpro162021/preview.png) (2021) [3456 x 2234] - `75da9011a54ecd48e3da2c20e2c8afd0`
* *Silver*
* *Space Gray*
* *Silver* ⬜️
* *Space Gray* ⬛️
* [Google Pixelbook Go](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/pixelbookgo/preview.png) (2019) [1920 x 1080] - `c6ef98219e013c1dca8480b3dba14caa`
* *Just Black*
* *Just Black* ⬛️
* [Apple Pro Display XDR](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/prodisplayxdr/preview.png) (2019) [6016 x 3384] - `148a8f19517b4359cfe9db9092bb85a1`
* *Silver*
* *Silver* ⬜️
* [Microsoft Surface Book](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/surfacebook/preview.png) (2015) [3000 x 2000] - `08816799dd7ebd63a9fe2e5a46f8b69c`
* *Platinum*
* *Platinum* ⬜️
### Tablets
* [Apple iPad 9](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/ipad9/preview.png) (2021) [2160 x 1620] - `347347da85ed8817ecd8eefd8fe22a0e`
* *Gold*
* *Silver*
* *Space Gray*
* *Gold* 🟨
* *Silver* ⬜️
* *Space Gray* ⬛️
* [Apple iPad Air 4](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/ipadair4/preview.png) (2020) [2360 x 1640] - `9a644764f99ccbe46753de8516e053fe`
* *Green*
* *Rose Gold*
* *Silver*
* *Sky Blue*
* *Space Gray*
* *Green* 🟩
* *Rose Gold* 🟨
* *Silver* ⬜️
* *Sky Blue* 🟦
* *Space Gray* ⬛️
* [Apple iPad Mini 5](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/ipadmini5/preview.png) (2021) [2048 x 1536] - `d8e92692708b63e444300f3b6dfacc6f`
* *Gold*
* *Silver*
* *Space Gray*
* *Gold* 🟨
* *Silver* ⬜️
* *Space Gray* ⬛️
* [Apple iPad Pro 4 11"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/ipadpro114/preview.png) (2020) [2388 x 1668] - `a80a78a3f7492bb5d460c59de173bc88`
* *Silver*
* *Space Gray*
* *Silver* ⬜️
* *Space Gray* ⬛️
* [Apple iPad Pro 4 12.9"](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/ipadpro134/preview.png) (2020) [2732 x 2048] - `198018d62640d23de5ae4e3e6cbc5fd0`
* *Silver*
* *Space Gray*
* *Silver* ⬜️
* *Space Gray* ⬛️
* [Microsoft Surface Pro 3](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/surfacepro3/preview.png) (2014) [2160 x 1440] - `d250f0d3f84dd0b972c152ee592fbc3a`
* *Platinum*
* *Platinum* ⬜️
* [Microsoft Surface Pro 4](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/surfacepro4/preview.png) (2015) [2736 x 1824] - `604015046fcf51f1a264bb0333269f80`
* *Platinum*
* *Platinum* ⬜️
### Wearable devices
* [Apple Watch Series 6 44mm](https://raw.githubusercontent.com/ulbwazhine/MockupEngineer/main/MockupEngineer/templates/watchseries644mm/preview.png) (2020) [448 x 368] - `085a3fafbdec1f728aed9882adc2c5b0`
* *Aluminum Case - Blue*
* *Aluminum Case - Gold*
* *Aluminum Case - Space Gray*
* *Aluminum Case - Silver*
* *Aluminum Case - Product Red*
* *Titanium Case - Light*
* *Titanium Case - Dark*
* *Stainless Steel Case - Gold*
* *Stainless Steel Case - Graphite*
* *Stainless Steel Case - Silver*
* *Aluminum Case - Blue* 🟦
* *Aluminum Case - Gold* 🟨
* *Aluminum Case - Product Red* 🟥
* *Aluminum Case - Silver* ⬜️
* *Aluminum Case - Space Gray* ⬛️
* *Stainless Steel Case - Gold* 🟨
* *Stainless Steel Case - Graphite* ⬛️
* *Stainless Steel Case - Silver* ⬜️
* *Titanium Case - Dark* ⬛️
* *Titanium Case - Light* ⬜️
You can help the project by adding support for new mockups by contributing on [GitHub](https://github.com/ulbwazhine/MockupEngineer).

View File

@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name='MockupEngineer',
version='2022.03.23.1',
version='2022.03.24.1',
packages=find_packages(),
url='https://github.com/ulbwazhine/MockupEngineer',
license='MIT',