Jump to content
dfay

File action w/list of actions

Recommended Posts

I made a few fixes to your code but it's still not working for me either:

import json, os, subprocess, sys

cmd = ['./tag', '-r', '\*'] + json.loads(os.getenv('filesList'))
subprocess.call(cmd)

That fixed an error caused by a missing ] and puts all the arguments as separate list items, both of which I think are necessary, but it doesn't work....

 

Confirmed that it works on the command line.

 

@deanishe any ideas?

Edited by dfay

Share this post


Link to post
Share on other sites

I don't have tag and I can't download the workflows (cl.ly isn't responding), so I can't test it, but that \* is probably incorrect.


You aren't running a shell, so there's no need to escape special shell characters like *. It also won't work as a shell expansion either, of course.

 

Share this post


Link to post
Share on other sites

@dfay Thanks for taking a crack at it!

 

@deanishe Thanks for the suggestion, too. It works!!

 

So, for others that might be interested, the following modification to @dfay's code does the trick:

import json, os, subprocess, sys
cmd = ['./tag', '-r', '*'] + json.loads(os.getenv('filesList'))
subprocess.call(cmd)

Thanks a ton, @dfay & @deanishe!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...