Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Set SYSFS_PORT_SPLIT_RE #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

phhusson
Copy link

Test: Use path returned by adb devices -l (namely 1-13.3.3), and ensure
it has been parsed properly

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@coveralls
Copy link

coveralls commented May 31, 2017

Coverage Status

Coverage increased (+0.1%) to 47.692% when pulling 5359c17 on phhusson:fix-port-split into a9ea7b4 on google:master.

@coveralls
Copy link

coveralls commented May 31, 2017

Coverage Status

Coverage increased (+0.1%) to 47.692% when pulling c1851a2 on phhusson:fix-port-split into a9ea7b4 on google:master.

@phhusson
Copy link
Author

I've changed the git commit author address so that it matches a CLA I've already signed

Test: Use path returned by adb devices -l (namely 1-13.3.3), and ensure
it has been parsed properly
@coveralls
Copy link

coveralls commented May 31, 2017

Coverage Status

Coverage increased (+0.3%) to 47.84% when pulling fbeb7df on phhusson:fix-port-split into a9ea7b4 on google:master.

@fahhem
Copy link
Contributor

fahhem commented Feb 26, 2018

Finally getting back to these older PRs... Why did you remove the _PortPathAction class? I honestly don't remember what that regex was supposed to be, so yours seems fine.

@phhusson
Copy link
Author

phhusson commented Mar 2, 2018

Well, considering that PortPathMatcher splits and does the str to int conversion, it is a bit pointless to do it in the parameter parsing.

Another way to refactor this, is to change PortPathAction to take all the possible separators using the regexp, hence returning a list of ints, and delete the code from PortPathMatcher which splits strings.

@cclauss
Copy link

cclauss commented Sep 25, 2018

This is still an issue...

flake8 testing of https://github.com/google/python-adb on Python 3.6.3

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./adb/adb_commands.py:295:36: F821 undefined name 'file'
        elif isinstance(dest_file, file):
                                   ^
./adb/common.py:207:48: F821 undefined name 'SYSFS_PORT_SPLIT_RE'
            port_path = [int(part) for part in SYSFS_PORT_SPLIT_RE.split(port_path)]
                                               ^
./adb/filesync_protocol.py:142:87: F821 undefined name 'file'
            total_bytes = os.fstat(datafile.fileno()).st_size if isinstance(datafile, file) else -1
                                                                                      ^
3       F821 undefined name 'file'
3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants