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

Added choosing different dirmap mapping if workfile synched locally #2088

Merged

Conversation

kalisp
Copy link
Member

@kalisp kalisp commented Sep 29, 2021

Currently this checks if Site Sync is enabled (globally and for project) and if User has set active_site to local (eg. User is synching files locally). If so, it puts into dirmap root(s) from remote_site as a source and local site as a destination.
It completely ignores configuration in Settings, if anyone could produce use case when this would be needed, please go ahead and share.

(I am not super happy about mixing Site Sync logic with host implementation, but couldn't figure out better option.)

@kalisp kalisp added type: enhancement Enhancements to existing functionality host: Maya module: Sitesync labels Sep 29, 2021
@kalisp kalisp self-assigned this Sep 29, 2021
@mkolar
Copy link
Member

mkolar commented Sep 29, 2021

mapping["destination-path"] = [value]
mapping["source-path"] = [sync_settings["sites"]\
[remote_site]\
["root"]\
Copy link

Choose a reason for hiding this comment

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

the backslash is redundant between brackets
whitespace before '['

try:
mapping["destination-path"] = [value]
mapping["source-path"] = [sync_settings["sites"]\
[remote_site]\
Copy link

Choose a reason for hiding this comment

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

the backslash is redundant between brackets
whitespace before '['

if os.path.isdir(value):
try:
mapping["destination-path"] = [value]
mapping["source-path"] = [sync_settings["sites"]\
Copy link

Choose a reason for hiding this comment

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

the backslash is redundant between brackets
whitespace before '['

Copy link
Member

@mkolar mkolar left a comment

Choose a reason for hiding this comment

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

Awesome! this works really well actually.

@kalisp kalisp merged commit 54d18ce into develop Sep 30, 2021
@kalisp kalisp deleted the PYPE-1941_Run-different-dirmap-for-locally-synched-workfiles branch September 30, 2021 07:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Maya module: Sitesync type: enhancement Enhancements to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants