1
0
mirror of https://github.com/gryf/mc_adbfs.git synced 2025-12-18 12:00:19 +01:00

Fix bad filenames for Python3.

In Python3, if there are filenames encoded with 8-bit encodings, there
might be an issues with converting them into unicode objects. This is a
workaround on this subject. Python2 is not affected.

Other than that, there was tests added to cover this case, appropriate
Makefile which automate creating venvs for both: Python 2 and 3, and
also there is a check against pep8 rules using flake8.
This commit is contained in:
2019-05-14 21:10:28 +02:00
parent 63fdc2c605
commit 5ece2d579c
5 changed files with 184 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ Midnight Commander adbfs external fs plugin
This is Midnight Commander extfs plugin for browsing Android device through
``adb`` interface written in Python.
Rquirements
===========
@@ -24,6 +25,7 @@ Make sure, that issuing from command line:
it should display files from root directory on the device.
Features
========
@@ -35,12 +37,14 @@ Features
* Symbolic links in lists are corrected to be relative to the file system
* Symbolic links also point to the right target, skipping intermediate links
Installation
============
Copy adbfs into ``~/.local/share/mc/extfs.d/`` directory and make it executable
if needed.
Usage
=====
@@ -48,13 +52,14 @@ To use it, just issue:
.. code:: shell-session
cd adbfs://
$ cd adbfs://
under MC - after some time you should see the files and directories on your
device. For convenience you can add a bookmark (accessible under CTRL+\) for
device. For convenience you can add a bookmark (accessible under CTRL+\\) for
fast access. The time is depended on how many files and directories you have on
your device and how fast it is :)
Configuration
=============
@@ -72,7 +77,6 @@ You can configure behaviour of this plugin using ``.ini`` file located under
adb_command = adb
adb_connect =
where:
* ``debug`` will provide a little bit more verbose information, useful for
@@ -93,6 +97,43 @@ where:
feature. Typical value here is a device IP address with optional port, which
defaults to 5555.
Contribution
============
There is a ``Makefile`` in the top directory, which is basic helper for running
the tests. Please use it, and adapt/add tests for provided fixes/functionality.
It requires GNU ``make`` program, and also ``virtualenv`` besides Python in
version 2 and 3. Using it is simple as running following command:
.. code:: shell-session
$ make
it will run `py2`, `py3` and `flake8` jobs to check it against the code. For
running tests against Python 3:
.. code:: shell-session
$ make py3
or Python 2:
.. code:: shell-session
$ make py2
or flake 8:
.. code:: shell-session
$ make flake8
Exit status on any of those means that test fail. Appropriate message/traceback
will also be visible.
Limitations
===========
@@ -103,6 +144,7 @@ Limitations
* The implementation is experimental and it's by now working with mine device;
while it might not work with yours
License
=======