Skip to content

Commit

Permalink
Migrate to alfred-pyflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fedecalendino committed Jul 17, 2022
1 parent 7c423cd commit 1b1cb6b
Show file tree
Hide file tree
Showing 24 changed files with 269 additions and 5,645 deletions.
7 changes: 6 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.idea/
*pyc

build/

.idea/
.tmp/

Empty file modified LICENSE
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
### [Alfred Workflow](https://www.alfredapp.com/workflows/) to generate random values for different data types 🎲️
## ALFRED-RANDOMER

[Alfred Workflow](https://www.alfredapp.com/workflows/) to generate random values for different data types 🎲️


![all](./img/screenshots/all.png)
Expand Down
Empty file modified alfred-randomer
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
poetry run pyinstaller --onefile --paths ./src/ src/main.py

rm -rf ./build
rm *.spec
Binary file added dist/main
Binary file not shown.
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/screenshots/all.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/screenshots/imei.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 18 additions & 16 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<string>Tools</string>
<key>connections</key>
<dict>
<key>EC765E5B-D5EC-4893-B319-32CDD2BC7C5C</key>
<key>FE37874C-BB78-4D05-8F02-EA114E8BA312</key>
<array>
<dict>
<key>destinationuid</key>
<string>8C2A867D-8342-47CC-B605-C5A3D7740379</string>
<string>88A52F5F-CC59-4060-9DCC-796BEDC66EEE</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
Expand Down Expand Up @@ -47,7 +47,7 @@
<key>type</key>
<string>alfred.workflow.output.clipboard</string>
<key>uid</key>
<string>8C2A867D-8342-47CC-B605-C5A3D7740379</string>
<string>88A52F5F-CC59-4060-9DCC-796BEDC66EEE</string>
<key>version</key>
<integer>3</integer>
</dict>
Expand All @@ -71,23 +71,23 @@
<key>queuedelaycustom</key>
<integer>3</integer>
<key>queuedelayimmediatelyinitially</key>
<true/>
<false/>
<key>queuedelaymode</key>
<integer>0</integer>
<key>queuemode</key>
<integer>1</integer>
<integer>2</integer>
<key>runningsubtext</key>
<string>...</string>
<string></string>
<key>script</key>
<string>python3 ./main.py $@</string>
<string>./dist/main $@</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>subtext</key>
<string></string>
<key>title</key>
<string></string>
<string>Generate random values for different data types</string>
<key>type</key>
<integer>0</integer>
<key>withspace</key>
Expand All @@ -96,7 +96,7 @@
<key>type</key>
<string>alfred.workflow.input.scriptfilter</string>
<key>uid</key>
<string>EC765E5B-D5EC-4893-B319-32CDD2BC7C5C</string>
<string>FE37874C-BB78-4D05-8F02-EA114E8BA312</string>
<key>version</key>
<integer>3</integer>
</dict>
Expand All @@ -105,23 +105,25 @@
<string>Generate random values for different data types 🎲️</string>
<key>uidata</key>
<dict>
<key>8C2A867D-8342-47CC-B605-C5A3D7740379</key>
<key>88A52F5F-CC59-4060-9DCC-796BEDC66EEE</key>
<dict>
<key>xpos</key>
<integer>305</integer>
<real>280</real>
<key>ypos</key>
<integer>40</integer>
<real>15</real>
</dict>
<key>EC765E5B-D5EC-4893-B319-32CDD2BC7C5C</key>
<key>FE37874C-BB78-4D05-8F02-EA114E8BA312</key>
<dict>
<key>xpos</key>
<integer>55</integer>
<real>30</real>
<key>ypos</key>
<integer>40</integer>
<real>15</real>
</dict>
</dict>
<key>userconfigurationconfig</key>
<array/>
<key>version</key>
<string>1.2</string>
<string>1.3.0</string>
<key>webaddress</key>
<string>https://github.com/fedecalendino/alfred-randomer</string>
</dict>
Expand Down
209 changes: 209 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[tool.poetry]
name = "Randomer"
version = "1.3.0"
description = "Generate random values for different data types"
documentation = "https://github.com/fedecalendino/alfred-randomer/blob/main/README.md"
homepage = "https://github.com/fedecalendino/alfred-randomer"
license = "MIT"

authors = [
"Fede Calendino <fede@calendino.com>"
]

[tool.poetry.dependencies]
python = ">=3.8,<3.11"
alfred-pyflow = "latest"

[tool.poetry.dev-dependencies]
black = "latest"
coverage = "latest"
ddt = "latest"
pyinstaller = "latest"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
File renamed without changes.
2 changes: 1 addition & 1 deletion generators.py → src/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def random_unit_number():
]

values = list(map(lambda d: int(LETTER_VALUES.get(d, d)), number))
checksum = sum(d * 2 ** i for i, d in enumerate(values)) % 11
checksum = sum(d * 2**i for i, d in enumerate(values)) % 11

if checksum > 9:
return random_unit_number()
Expand Down
7 changes: 3 additions & 4 deletions main.py → src/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# coding=utf-8
import sys

from workflow import Workflow
from pyflow import Workflow

import generators

Expand All @@ -25,15 +24,15 @@ def main(workflow):
for name in items:
value = GENERATORS[name]()

workflow.add_item(
workflow.new_item(
title=value,
subtitle=name,
arg=value,
valid=True,
)


if __name__ == u"__main__":
if __name__ == "__main__":
wf = Workflow()
wf.run(main)
wf.send_feedback()
Expand Down
Binary file removed workflow/Notify.tgz
Binary file not shown.
Loading

0 comments on commit 1b1cb6b

Please sign in to comment.