-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SKB-2333] New 'pre_publish' hook to run before showing publish dialog (
#133)
- Loading branch information
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2018 Shotgun Software Inc. | ||
# | ||
# CONFIDENTIAL AND PROPRIETARY | ||
# | ||
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit | ||
# Source Code License included in this distribution package. See LICENSE. | ||
# By accessing, using, copying or modifying this work you indicate your | ||
# agreement to the Shotgun Pipeline Toolkit Source Code License. All rights | ||
# not expressly granted therein are reserved by Shotgun Software Inc. | ||
|
||
import sgtk | ||
|
||
HookBaseClass = sgtk.get_hook_baseclass() | ||
|
||
|
||
class PrePublishHook(HookBaseClass): | ||
""" | ||
This hook defines logic to be executed before showing the publish | ||
dialog. There may be conditions that need to be checked before allowing | ||
the user to proceed to publishing. | ||
""" | ||
|
||
def validate(self): | ||
""" | ||
Returns True if the user can proceed to publish. Override thsi hook | ||
method to execute any custom validation steps. | ||
""" | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fad5fa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@staceyoue Sorry to chip in here, but it occurred to me that calling this a "pre-publish" hook isn't the correct name to use. Historically(tk-multi-publish), pre-publish was the step AFTER collection. This hook would be more accurately labelled "pre-collection".
Publish doesn't occur after this hook; there's collection, validation, THEN publish.