Code Monkey home page Code Monkey logo

python-shortcuts's Issues

KeyError: 'VariableName'

Running in Pythonista 3 on iPad. Installed all the dependencies using the Stash add-on for Pythonista.

Traceback (most recent call last):
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts.py", line 5, in <module>
    main()
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts/cli.py", line 56, in main
    convert_shortcut(args.file, args.output)
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts/cli.py", line 18, in convert_shortcut
    sc = shortcuts.Shortcut.loads(sc_data, file_format=shortcuts.FMT_SHORTCUT)
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts/shortcut.py", line 53, in loads
    return cls._get_loader_class(file_format).loads(string)
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts/loader.py", line 69, in loads
    shortcut.actions.append(cls._action_from_dict(action))
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts/loader.py", line 85, in _action_from_dict
    for p, v in action_dict['WFWorkflowActionParameters'].items()
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts/loader.py", line 86, in <dictcomp>
    if p in shortcut_name_to_field_name
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts/loader.py", line 115, in deserialized_data
    return deserializer(self._data).deserialized_data
  File "/private/var/mobile/Containers/Shared/AppGroup/F82F97C6-B15F-41D4-B735-B51241CB9688/File Provider Storage/Repositories/python-shortcuts/shortcuts/loader.py", line 134, in deserialized_data
    return self._data['Value']['VariableName']
KeyError: 'VariableName'

Run_shortcut not working

I am having a problem getting the run shortcut action to work. I have it formatted like this.

[[action]]
type = "run_shortcut"
shortcut_name = "UpdateKit"
show = "False"

I get the error:
<class 'shortcuts.exceptions.UnknownActionError'>:
Unknown shortcut action: "run_shortcut"

Issue installing package

When trying to install the package I am getting the following error:

pip install shortcuts
Collecting shortcuts
  Using cached https://files.pythonhosted.org/packages/f1/cb/1924e5814706a0ef9140c0399c82a6a1257fb84756cd838684fd61732701/shortcuts-0.10.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Will\AppData\Local\Temp\pip-install-_62p5ag4\shortcuts\setup.py", line 19, in <module>
        readme = f.read()
      File "c:\users\will\python\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 277: character maps to <undefined>

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Will\AppData\Local\Temp\pip-install-_62p5ag4\shortcuts\

I've tried updating setuptools and have tried running as system admin to no luck

Windows 10 Home x64 happening on both Python 3.7.2 & 3.6.8

List of every action built into shortcuts and their parameters

If you want to be able to add actions more easily, @xAlien95 extracted a plist of all the actions in shortcuts 2.1.2,

https://raw.githubusercontent.com/pfgithub/shortcutslang/33a323c0d0356dd51730580a6574ab86431f10c6/src/Data/Shortcuts%202.1.2.json

It's missing some things like the blocks in if, choose from menu, repeat, and repeat with each. It also doesn't list any arguments for the Get Details of * and Filter * actions. It should make it easier to add actions, or if you want to it makes it possible to automate adding them.

A project with a similar scope

Hey Alexander! 👋

I've just been pointed your way by this thread on r/shortcuts and I thought I'd drop you a message. I know that an issue isn't the best place for this, but hey ho!

I've just released Shortcuts JS which has a very similar scope to python-shortcuts, but is implemented in JavaScript rather than Python. As the projects have such a similar scope, there may well be things that can be learnt from one another's projects, so I thought I'd just introduce myself and point you in the direction of the repo, on the off chance there's something there you find interesting or useful.

I can already see that python-shortcuts implements some additional features that I'm hoping to add to Shortcuts JS at some point, mainly the shortcut → toml feature, which in my case would likely be shortcut -> JSON, or possibly shortcut -> JS.

Anyway, keep up the great work!

name: str = '', ^ SyntaxError: invalid syntax

File "/Library/Python/2.7/site-packages/shortcuts/shortcut.py", line 22 name: str = '', ^ SyntaxError: invalid syntax

Keep getting this.

Tried to run the example python as a script to produce the .shortcut

url error

shortcuts https://www.icloud.com/shortcuts/f50e51246720489c85d01149694b214b b.toml
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/shortcuts", line 13, in
load_entry_point('shortcuts==0.10.0', 'console_scripts', 'shortcuts')()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/cli.py", line 79, in main
convert_shortcut(args.file, args.output)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/cli.py", line 34, in convert_shortcut
sc = shortcuts.Shortcut.loads(sc_data, file_format=shortcuts.FMT_SHORTCUT)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/shortcut.py", line 53, in loads
return cls._get_loader_class(file_format).loads(string)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/loader.py", line 71, in loads
shortcut.actions.append(cls._action_from_dict(action))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/loader.py", line 88, in _action_from_dict
for p, v in action_dict['WFWorkflowActionParameters'].items()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/loader.py", line 89, in
if p in shortcut_name_to_field_name
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/loader.py", line 120, in deserialized_data
return deserializer(self._data).deserialized_data
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/loader.py", line 145, in deserialized_data
f'Unknown token attachment type: {field_type}',
shortcuts.exceptions.UnknownWFTextTokenAttachment: Unknown token attachment type: ActionOutput


sudo shortcuts https://www.icloud.com/shortcuts/c92f72b4f82d4f09bb3e7f60d690a1d9 a.toml
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/shortcuts", line 13, in
load_entry_point('shortcuts==0.10.0', 'console_scripts', 'shortcuts')()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/cli.py", line 79, in main
convert_shortcut(args.file, args.output)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/cli.py", line 34, in convert_shortcut
sc = shortcuts.Shortcut.loads(sc_data, file_format=shortcuts.FMT_SHORTCUT)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/shortcut.py", line 53, in loads
return cls._get_loader_class(file_format).loads(string)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/loader.py", line 71, in loads
shortcut.actions.append(cls._action_from_dict(action))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/loader.py", line 81, in _action_from_dict
action_params=action_dict,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/shortcuts/actions/registry.py", line 75, in get_by_itype
raise exceptions.UnknownActionError(itype, action_dict=action_params)
shortcuts.exceptions.UnknownActionError:
Unknown shortcut action: "is.workflow.actions.choosefromlist"

        Please, check documentation to add new shortcut action, or create an issue:
        Docs: https://github.com/alexander-akhmetov/python-shortcuts/tree/master/docs/new_action.md

        https://github.com/alexander-akhmetov/python-shortcuts/

        Action dictionary:

        {'WFWorkflowActionIdentifier': 'is.workflow.actions.choosefromlist', 'WFWorkflowActionParameters': {'WFChooseFromListActionPrompt': '加密安全性?', 'CustomOutputName': 'Security Type', 'UUID': 'C704598C-0FB2-49D6-A04A-DBB4D29755E1'}}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.