1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-07 12:13:32 +00:00

transformations first steps

This commit is contained in:
deadc0de6
2018-02-07 10:21:15 +01:00
parent fa62ffeef7
commit ef1fffd1a1
4 changed files with 28 additions and 2 deletions

View File

@@ -24,6 +24,18 @@ class Action:
except KeyboardInterrupt:
self.log.warn('action interrupted')
def transform(self, arg0, arg1):
'''execute transformation with {0} and {1}
where {0} is the file to transform and
{1} is the result file'''
cmd = self.action.format(arg0, arg1)
self.log.sub('transforming with \"%s\"' % (cmd))
try:
subprocess.call(cmd, shell=True)
except KeyboardInterrupt:
self.log.warn('action interrupted')
return arg1
def __str__(self):
return 'key:%s -> \"%s\"' % (self.key, self.action)