Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Major fixes, among them windows file handling #44

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pythonx/netranger/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ def on_stderr(job_id, err_msg):
pickle.dump(arguments, f)

if sudo:
Vim.AsyncRun('sudo {} {} {}'.format(self.ServerCmd, cmd, fname),
Vim.AsyncRun('sudo {} {} {}'.format(self.ServerCmd, cmd, fname).replace('\\','\\\\'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to put the replace in Vim.AsyncRun

on_exit=on_exit,
term=True)
else:
Vim.AsyncRun('{} {} {}'.format(self.ServerCmd, cmd, fname),
Vim.AsyncRun('{} {} {}'.format(self.ServerCmd, cmd, fname).replace('\\','\\\\'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

on_stderr=on_stderr,
on_exit=on_exit)

Expand All @@ -197,6 +197,7 @@ def mv(self, src_arr, dst, sudo=False, on_exit=None):

@classmethod
def cp(self, src_arr, dst, sudo=False, on_exit=None):
print("uuu",src_arr,dst)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

self.exec_server_cmd('cp',
on_exit, {
'src': src_arr,
Expand Down
6 changes: 5 additions & 1 deletion pythonx/netranger/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

def GenNetRangerScriptCmd(script):
python = sys.executable
path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
if os.name == 'nt':
path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
f'..\\{script}.py')
else:
path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
f'../{script}.py')
return f'{python} {path}'