strip arguments from macros, change some macro names
This commit is contained in:
parent
d0d1caa96c
commit
ad43e5993a
2 changed files with 6 additions and 6 deletions
|
@ -32,9 +32,9 @@ class PackageFormatter:
|
||||||
if type(arg) == Attributes:
|
if type(arg) == Attributes:
|
||||||
new_args.append(getattr(self, arg.value))
|
new_args.append(getattr(self, arg.value))
|
||||||
elif type(arg) == Args:
|
elif type(arg) == Args:
|
||||||
new_args.append(match_groups[arg.value])
|
new_args.append(match_groups[arg.value].strip())
|
||||||
elif type(arg) == str:
|
elif type(arg) == str:
|
||||||
new_args.append(arg)
|
new_args.append(arg.strip())
|
||||||
else:
|
else:
|
||||||
new_args += 'ERROR'
|
new_args += 'ERROR'
|
||||||
new_args = tuple(new_args)
|
new_args = tuple(new_args)
|
||||||
|
@ -43,7 +43,7 @@ class PackageFormatter:
|
||||||
if type(user_kwargs[kw]) == Attributes:
|
if type(user_kwargs[kw]) == Attributes:
|
||||||
new_kwargs[kw] = getattr(self, user_kwargs[kw].value)
|
new_kwargs[kw] = getattr(self, user_kwargs[kw].value)
|
||||||
elif type(user_kwargs[kw]) == Args:
|
elif type(user_kwargs[kw]) == Args:
|
||||||
new_kwargs[kw] = match_groups[user_kwargs[kw].value]
|
new_kwargs[kw] = match_groups[user_kwargs[kw].value].strip()
|
||||||
elif type(user_kwargs[kw]) == str:
|
elif type(user_kwargs[kw]) == str:
|
||||||
new_kwargs[kw] = user_kwargs[kw]
|
new_kwargs[kw] = user_kwargs[kw]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -22,9 +22,9 @@ def make_default_commands(package_formatter: PackageFormatter):
|
||||||
package_formatter.add_replacement('file name', '{name}', name=Attributes.file_name)
|
package_formatter.add_replacement('file name', '{name}', name=Attributes.file_name)
|
||||||
package_formatter.add_replacement('date', '{}', Attributes.date)
|
package_formatter.add_replacement('date', '{}', Attributes.date)
|
||||||
package_formatter.add_replacement('author', '{}', Attributes.author)
|
package_formatter.add_replacement('author', '{}', Attributes.author)
|
||||||
package_formatter.add_arg_replacement(1, 'newif', r'\newif\if{prefix}{condition}',
|
package_formatter.add_arg_replacement(2, 'new if', r'\newif\if{prefix}{condition}\{prefix}{condition}{value}',
|
||||||
prefix=Attributes.package_prefix, condition=Args.one)
|
prefix=Attributes.package_prefix, condition=Args.one, value=Args.two)
|
||||||
package_formatter.add_arg_replacement(2, 'setif', r'\{prefix}{condition}{value}',
|
package_formatter.add_arg_replacement(2, 'set if', r'\{prefix}{condition}{value}',
|
||||||
prefix=Attributes.package_prefix, condition=Args.one, value=Args.two)
|
prefix=Attributes.package_prefix, condition=Args.one, value=Args.two)
|
||||||
package_formatter.add_arg_replacement(1, 'if', r'\if{prefix}{condition}', prefix=Attributes.package_prefix,
|
package_formatter.add_arg_replacement(1, 'if', r'\if{prefix}{condition}', prefix=Attributes.package_prefix,
|
||||||
condition=Args.one)
|
condition=Args.one)
|
||||||
|
|
Loading…
Reference in a new issue