|
|
@ -119,15 +119,16 @@ class Generator(InterpreterObject): |
|
|
|
rule = kwargs['output_name'] |
|
|
|
rule = kwargs['output_name'] |
|
|
|
if not isinstance(rule, str): |
|
|
|
if not isinstance(rule, str): |
|
|
|
raise InvalidArguments('"output_name" keyword argument must be a string.') |
|
|
|
raise InvalidArguments('"output_name" keyword argument must be a string.') |
|
|
|
if not '@BASENAME@' in rule: |
|
|
|
if not '@BASENAME@' in rule and not '@PLAINNAME@' in rule: |
|
|
|
raise InvalidArguments('"output_name" must contain @BASENAME@.') |
|
|
|
raise InvalidArguments('"output_name" must contain @BASENAME@ or @PLAINNAME@.') |
|
|
|
if '/' in rule: |
|
|
|
if '/' in rule: |
|
|
|
raise InvalidArguments('"output_name" must not contain a slash.') |
|
|
|
raise InvalidArguments('"output_name" must not contain a slash.') |
|
|
|
self.name_rule = rule |
|
|
|
self.name_rule = rule |
|
|
|
|
|
|
|
|
|
|
|
def get_base_outname(self, inname): |
|
|
|
def get_base_outname(self, inname): |
|
|
|
base = os.path.split(inname)[1] |
|
|
|
plainname = os.path.split(inname)[1] |
|
|
|
return self.name_rule.replace('@BASENAME@', base) |
|
|
|
basename = plainname.split('.')[0] |
|
|
|
|
|
|
|
return self.name_rule.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname) |
|
|
|
|
|
|
|
|
|
|
|
def process_method(self, args, kwargs): |
|
|
|
def process_method(self, args, kwargs): |
|
|
|
if len(kwargs) > 0: |
|
|
|
if len(kwargs) > 0: |
|
|
|