1
0
mirror of https://github.com/gryf/mc_adbfs.git synced 2026-03-27 13:53:35 +01:00

11 Commits
0.14 ... 0.15

Author SHA1 Message Date
8f3a22a729 Removed py2 lefotver, fix variable name. 2022-12-31 11:23:42 +01:00
cbef13ccea Merge pull request #5 from fanick1/master
fix typo: quite->quote
2022-12-29 19:54:58 +01:00
fanick1
9cfa834604 fix typo: quite->quote 2022-12-28 23:31:02 +01:00
b1a6219d21 Removed deprecated encoding argument from json.loads. 2020-12-07 19:08:29 +01:00
d16f0f06b8 Merge branch 'thp-various-fixes' 2020-06-09 19:55:21 +02:00
c2f07f5516 Merge branch 'various-fixes' of https://github.com/thp/mc_adbfs into thp-various-fixes 2020-06-09 19:55:06 +02:00
e9b196eaf8 Change SafeConfigParser to ConfigParser 2020-05-21 10:10:43 +02:00
039c078a35 Fix missing attribute on conf object 2020-04-26 13:48:21 +02:00
Thomas Perl
b088c45d3f Fix quoting for 'adb shell' 2019-05-09 11:58:29 +02:00
Thomas Perl
c5559f7d41 Python 3's ConfigParser is already the safe one 2019-05-09 11:38:21 +02:00
Thomas Perl
9ffa1a13af Default to Python 3 2019-05-09 11:38:00 +02:00
3 changed files with 7 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ endif
ifeq ($(FL8_EXISTS), 0) ifeq ($(FL8_EXISTS), 0)
virtualenv_flake8: virtualenv_flake8:
virtualenv -p python2 $(FL8_VENV) virtualenv -p python3 $(FL8_VENV)
$(FL8_VENV)/bin/pip install flake8 $(FL8_VENV)/bin/pip install flake8
else else
virtualenv_flake8: virtualenv_flake8:

View File

@@ -76,6 +76,7 @@ You can configure behaviour of this plugin using ``.ini`` file located under
root = root =
adb_command = adb adb_command = adb
adb_connect = adb_connect =
try_su = false
where: where:

9
adbfs
View File

@@ -80,6 +80,7 @@ class Conf(object):
self.suppress_colors = False self.suppress_colors = False
self.adb_command = 'adb' self.adb_command = 'adb'
self.adb_connect = '' self.adb_connect = ''
self.try_su = False
self.read() self.read()
self.connect() self.connect()
@@ -187,7 +188,7 @@ class Conf(object):
if not os.path.exists(conf_fname): if not os.path.exists(conf_fname):
return return
cfg = configparser.SafeConfigParser() cfg = configparser.ConfigParser()
cfg_map = {'debug': (cfg.getboolean, 'debug'), cfg_map = {'debug': (cfg.getboolean, 'debug'),
'dirs_to_skip': (cfg.get, 'dirs_to_skip'), 'dirs_to_skip': (cfg.get, 'dirs_to_skip'),
'suppress_colors': (cfg.get, 'suppress_colors'), 'suppress_colors': (cfg.get, 'suppress_colors'),
@@ -204,7 +205,7 @@ class Conf(object):
pass pass
if self.dirs_to_skip and isinstance(self.dirs_to_skip, str): if self.dirs_to_skip and isinstance(self.dirs_to_skip, str):
self.dirs_to_skip = json.loads(self.dirs_to_skip, encoding='ascii') self.dirs_to_skip = json.loads(self.dirs_to_skip)
self.dirs_to_skip = [x.encode('utf-8') for x in self.dirs_to_skip] self.dirs_to_skip = [x.encode('utf-8') for x in self.dirs_to_skip]
else: else:
self.dirs_to_skip = [] self.dirs_to_skip = []
@@ -412,7 +413,7 @@ class Adb(object):
sys.stderr.write('Cannot read directory. Is device connected?\n') sys.stderr.write('Cannot read directory. Is device connected?\n')
return 1 return 1
lines = [l.strip() for l in lines.split('\n') if l.strip()] lines = [line.strip() for line in lines.split('\n') if line.strip()]
if len(lines) == 1: if len(lines) == 1:
reg_match = self.file_re.match(lines[0]) reg_match = self.file_re.match(lines[0])
entry = File(**reg_match.groupdict()) entry = File(**reg_match.groupdict())
@@ -458,7 +459,7 @@ class Adb(object):
if not root: if not root:
lscmd = self.conf.box['ls'] lscmd = self.conf.box['ls']
else: else:
lscmd = self.conf.box['rls'].format(shlex.quite(root.filepath)) lscmd = self.conf.box['rls'].format(shlex.quote(root.filepath))
command = self._shell_cmd(True, *shlex.split(lscmd)) command = self._shell_cmd(True, *shlex.split(lscmd))