Manually fixing these arguments at the string stage is unsatisfactory and should probably be changed somehow, but we can't leave it until later as the build.py scripts assume they are in the current directory. works in-place :param args: parser args
(args)
| 963 | |
| 964 | @staticmethod |
| 965 | def _fix_args(args): |
| 966 | """ |
| 967 | Manually fixing these arguments at the string stage is |
| 968 | unsatisfactory and should probably be changed somehow, but |
| 969 | we can't leave it until later as the build.py scripts assume |
| 970 | they are in the current directory. |
| 971 | works in-place |
| 972 | :param args: parser args |
| 973 | """ |
| 974 | |
| 975 | fix_args = ('--dir', '--private', '--add-jar', '--add-source', |
| 976 | '--whitelist', '--blacklist', '--presplash', '--icon', |
| 977 | '--icon-bg', '--icon-fg') |
| 978 | unknown_args = args.unknown_args |
| 979 | |
| 980 | for asset in args.assets: |
| 981 | if ":" in asset: |
| 982 | asset_src, asset_dest = asset.split(":") |
| 983 | else: |
| 984 | asset_src = asset_dest = asset |
| 985 | # take abspath now, because build.py will be run in bootstrap dir |
| 986 | unknown_args += ["--asset", os.path.abspath(asset_src)+":"+asset_dest] |
| 987 | for resource in args.resources: |
| 988 | if ":" in resource: |
| 989 | resource_src, resource_dest = resource.split(":") |
| 990 | else: |
| 991 | resource_src = resource |
| 992 | resource_dest = "" |
| 993 | # take abspath now, because build.py will be run in bootstrap dir |
| 994 | unknown_args += ["--resource", os.path.abspath(resource_src)+":"+resource_dest] |
| 995 | for i, arg in enumerate(unknown_args): |
| 996 | argx = arg.split('=') |
| 997 | if argx[0] in fix_args: |
| 998 | if len(argx) > 1: |
| 999 | unknown_args[i] = '='.join( |
| 1000 | (argx[0], realpath(expanduser(argx[1])))) |
| 1001 | elif i + 1 < len(unknown_args): |
| 1002 | unknown_args[i+1] = realpath(expanduser(unknown_args[i+1])) |
| 1003 | |
| 1004 | @staticmethod |
| 1005 | def _prepare_release_env(args): |