File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import logging
22import subprocess
33import os
4+ import sys
45
56
67class RCloneWrapper :
@@ -11,9 +12,9 @@ def __init__(self, cfg):
1112 self .cfg = '\n ' .join (f'[{ name } ]\n ' + '\n ' .join (f'{ k } = { v } ' for k ,
1213 v in settings .items ()) for name , settings in cfg .items ())
1314 self .log = logging .getLogger ("RClone" )
14- cur_dir = os .path .dirname (os .path .realpath (__file__ ))
15- self .config_path = os .path .join (cur_dir , "rclone.conf" )
16- self .rclone_path = os .path .join (cur_dir , "rclone" )
15+ wrapper_dir = os .path .dirname (os .path .realpath (__file__ ))
16+ self .config_path = os .path .join (wrapper_dir , "rclone.conf" )
17+ self .rclone_path = os .path .join (sys . prefix , "pyrclone" , "rclone" )
1718
1819 def _execute (self , command_with_args ):
1920 # print(command_with_args)
Original file line number Diff line number Diff line change 44
55PROJECT_NAME = 'pyrclone'
66if os .name == 'nt' : # Windows
7- rclone_binary = (f'lib\site-packages\ { PROJECT_NAME } ' , ['win/rclone.exe' ])
7+ rclone_binary = (f'{ PROJECT_NAME } ' , ['win/rclone.exe' ])
88elif os .name == 'posix' : # Unix-like
99 if os .uname ().sysname == 'Linux' :
10- rclone_binary = (f'lib\site-packages\ { PROJECT_NAME } ' , ['linux/rclone' ])
10+ rclone_binary = (f'{ PROJECT_NAME } ' , ['linux/rclone' ])
1111 elif os .uname ().sysname == 'Darwin' :
12- rclone_binary = (f'lib\site-packages\ { PROJECT_NAME } ' , ['mac/rclone' ])
12+ rclone_binary = (f'{ PROJECT_NAME } ' , ['mac/rclone' ])
1313else :
1414 raise NotImplementedError ('Unsupported OS' )
1515
You can’t perform that action at this time.
0 commit comments