Skip to content

Bug/Feature request: Check paths from arguments first, build then #832

Closed

Description

@KeyWeeUsr

If I set --presplash or something similar that's not main.py/main.pyo catcher, it reports if the paths isn't available, but after the whole build is done and .apk is being compiled, which I think may not be the best approach. Although it depends on bootstrap's build.py file, it might be a good thing to check paths before building than fail later.

Traceback (most recent call last):
  File "/usr/local/bin/p4a", line 9, in <module>
    load_entry_point('python-for-android==0.4', 'console_scripts', 'p4a')()
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 775, in main
    ToolchainCL()
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 450, in __init__
    getattr(self, args.subparser_name.replace('-', '_'))(args)
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 143, in wrapper_func
    func(self, args)
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 633, in apk
    build_args = build.parse_args(args.unknown_args)
  File "/home/kivy/.local/share/python-for-android/dists/unnamed_dist_1/build.py", line 521, in parse_args
    make_package(args)
  File "/home/kivy/.local/share/python-for-android/dists/unnamed_dist_1/build.py", line 346, in make_package
    'res/drawable/presplash.jpg')
  File "/usr/lib/python2.7/shutil.py", line 119, in copy
    copyfile(src, dst)
  File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/home/kivy/launcher-presplash.png'

That .png for presplash was only a typo, should be .jpg, but anyway, it was reported a way later than expected.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. inclement commented on Jul 10, 2016

    @inclement
    Member

    You mean that p4a should check if the launcher image exists during the apk build?

  2. KeyWeeUsr commented on Jul 10, 2016

    @KeyWeeUsr
    ContributorAuthor

    No, before that. Example: if someone types p4a apk --argument <path>, check if file or folder is actually there and download & build then, which is more user-friendly, because if user forgets separator, makes a typo or similar thing, it reports after everything is compiled and .apk starts packaging. If you have 20packages, then it's way to late.

    Basically, not only checking if arguments are valid, but if the values are valid too.

  3. inclement commented on Jul 10, 2016

    @inclement
    Member

    In principle it doesn't really matter if it isn't there, because the build doesn't have to be repeated. PRs to do this kind of thing are welcome though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions