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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user