Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/models/batch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import re
from sqlalchemy import Column, String

from database import Base
Expand Down Expand Up @@ -26,6 +27,11 @@ def command(self):
var_map = map(lambda v: '='.join([v.key, v.value]), var_models)
var_str = ' && '.join(var_map)
cmd = self.config_model.command()
# replace any instances of the variable in cmd with the lowercase
for variable in [var_model.key for var_model in var_models]:
matches = re.findall(variable, cmd, re.IGNORECASE)
for match in matches:
cmd = re.sub(match, variable, cmd)
if var_str: cmd = ' && '.join([var_str, cmd])
return cmd

Expand Down
3 changes: 2 additions & 1 deletion src/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def help(self):
return self.data['help']

def args(self):
return self.arguments or []
if self.arguments: return [str(a).lower() for a in self.arguments]
else: return []

# TODO: Deprecated, avoid usage
def interactive_only(self):
Expand Down