@@ -74,18 +74,11 @@ def set_current_user_sync_path(sync_path):
74
74
75
75
def get_resource_path (resource = '' , user = '' , space = '' ):
76
76
sync_path = get_config ('currentUserSyncPath' )
77
- if not sync_path .startswith (get_config ('tempFolderPath' )):
78
- if user :
79
- sync_path = user
80
- else :
81
- user = parse_username_from_sync_path (sync_path )
82
- if get_config ('ocis' ):
83
- space = (
84
- space
85
- or get_config ('syncConnectionName' )
86
- or get_displayname_for_user (user )
87
- )
88
- sync_path = join (sync_path , space )
77
+ if user :
78
+ sync_path = user
79
+ if get_config ('ocis' ):
80
+ space = space or get_config ('syncConnectionName' )
81
+ sync_path = join (sync_path , space )
89
82
sync_path = join (get_config ('clientRootSyncPath' ), sync_path )
90
83
resource = resource .replace (sync_path , '' ).strip ('/' ).strip ('\\ ' )
91
84
if is_windows ():
@@ -96,10 +89,6 @@ def get_resource_path(resource='', user='', space=''):
96
89
)
97
90
98
91
99
- def parse_username_from_sync_path (sync_path ):
100
- return sync_path .split ('/' ).pop ()
101
-
102
-
103
92
def get_temp_resource_path (resource_name ):
104
93
return join (get_config ('tempFolderPath' ), resource_name )
105
94
@@ -168,10 +157,12 @@ def generate_account_config(users, space='Personal'):
168
157
server_url = get_config ('localBackendUrl' )
169
158
170
159
if is_ocis := get_config ('ocis' ):
171
- if space == 'Personal' :
172
- space = get_displayname_for_user (username )
160
+ set_config ('syncConnectionName' , space )
173
161
sync_path = create_space_path (space )
174
- dav_endpoint = url_join ('dav/spaces' , get_space_id (space , username ))
162
+ space_name = space
163
+ if space == 'Personal' :
164
+ space_name = get_displayname_for_user (username )
165
+ dav_endpoint = url_join ('dav/spaces' , get_space_id (space_name , username ))
175
166
176
167
args = {
177
168
'url' : url_join (server_url , dav_endpoint , '' ),
@@ -199,10 +190,7 @@ def generate_account_config(users, space='Personal'):
199
190
return sync_paths
200
191
201
192
202
- def setup_client (username , space = None ):
203
- if not space or space == 'Personal' :
204
- space = get_displayname_for_user (username )
205
- set_config ('syncConnectionName' , space )
193
+ def setup_client (username , space = 'Personal' ):
206
194
sync_paths = generate_account_config ([username ], space )
207
195
start_client ()
208
196
for _ , sync_path in sync_paths .items ():
0 commit comments