Changeset a2e54d9 in rattail
- Timestamp:
- 10/31/2022 08:52:06 PM (3 months ago)
- Branches:
- master
- Children:
- 5900035
- Parents:
- 5bcc3ba
- Location:
- rattail
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
rattail/luigi/handler.py
r5bcc3ba ra2e54d9 29 29 import os 30 30 import logging 31 import shlex32 31 import subprocess 33 32 import sys … … 38 37 39 38 from rattail.app import GenericHandler 39 from rattail.util import shlex_join 40 40 41 41 … … 133 133 cmd] 134 134 135 cmd = ['echo', shlex .join(cmd)]136 cmd = shlex .join(cmd)135 cmd = ['echo', shlex_join(cmd)] 136 cmd = shlex_join(cmd) 137 137 138 138 cmd = "{} | at 'now + 1 minute'".format(cmd) … … 221 221 'run-n-mail', 222 222 '-S', 'Backfill thru {}: {}'.format(last_date, task['description']), 223 shlex .join(cmd)]224 225 cmd = ['echo', shlex .join(cmd)]226 cmd = shlex .join(cmd)223 shlex_join(cmd)] 224 225 cmd = ['echo', shlex_join(cmd)] 226 cmd = shlex_join(cmd) 227 227 228 228 cmd = "{} | at 'now + 1 minute'".format(cmd) -
rattail/util.py
r5bcc3ba ra2e54d9 28 28 from __future__ import division 29 29 30 import shlex 30 31 import sys 31 32 import datetime … … 365 366 return "{}: {}".format(cls, msg) 366 367 return cls 368 369 370 def shlex_join(split_command): 371 """ 372 Wrapper which invokes ``shlex.join()`` if available; otherwise 373 a workaround is implemented. 374 375 cf. https://stackoverflow.com/a/50022816 376 """ 377 if hasattr(shlex, 'join'): 378 return shlex.join(split_command) 379 380 return ' '.join(shlex.quote(x) for x in split_command)
Note: See TracChangeset
for help on using the changeset viewer.