本文整理汇总了Python中shotgun_api3.Shotgun.find方法的典型用法代码示例。如果您正苦于以下问题:Python Shotgun.find方法的具体用法?Python Shotgun.find怎么用?Python Shotgun.find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shotgun_api3.Shotgun
的用法示例。
在下文中一共展示了Shotgun.find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AppServerSvc
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
class AppServerSvc(win32serviceutil.ServiceFramework):
_svc_name_ = "timelog"
_svc_display_name_ = "shotgun time log"
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
SetConsoleCtrlHandler(lambda x: True, True)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
self.count = 0
self.estinmins = 0
self.isAlive = True
self.envv = ""
self.prlist = []
def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
win32event.SetEvent(self.hWaitStop)
self.run = False
def SvcDoRun(self):
servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE, servicemanager.PYS_SERVICE_STARTED, (self._svc_name_, "")
)
self.sg = Shotgun(
"https://xxxxxxxxxxxxxxxx.shotgunstudio.com", "timelogservice", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
self.main()
def updateProject(self, projectid):
servicemanager.LogWarningMsg(unicode(projectid))
filters = [["project.Project.id", "is", projectid]]
fields = ["time_logs_sum", "est_in_mins"]
for eventTimeLog in self.sg.find("Task", filters, fields):
self.count = self.count + eventTimeLog["time_logs_sum"]
if eventTimeLog["est_in_mins"] is not None:
self.estinmins = self.estinmins + eventTimeLog["est_in_mins"]
data = {"sg_artisttimelog": self.count / 600}
asset = self.sg.update("Project", projectid, data)
data = {"sg_total_bid": self.estinmins / 600}
asset = self.sg.update("Project", projectid, data)
def main(self):
while self.isAlive:
filters = [["sg_status", "is", "active"]]
fields = ["id"]
for f in self.sg.find("Project", filters, fields):
self.prlist.append(f["id"])
for prid in self.prlist:
self.updateProject(prid)
self.count = 0
self.estinmins = 0
if win32event.WaitForSingleObject(self.hWaitStop, 3000) == win32event.WAIT_OBJECT_0:
break
示例2: submitShotgunTicket
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
def submitShotgunTicket(output, jobList):
currentuser = str(User.currentUser().name())
title = "AtS - %s"%currentuser
desc = []
desc.append(output+"\n")
desc.append("JOBLIST:")
for job in jobList:
desc.append(str(job.key())+" - "+str(job.name()))
sg = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
id = sg.find("HumanUser",[['login','is',currentuser]],['id'])
userid = id[0]
ticket_data = {
'created_by': {'type':'HumanUser','id':userid['id']},
'title': title,
'description': "\n".join(desc),
'addressings_to':[{'type':'Group', 'id':19}, {'type':'HumanUser','id':userid['id']}],
'project': {'type':'Project', 'id':178},
'sg_service': {'type':'CustomNonProjectEntity01', 'id':27},
}
sg_ticket = sg.create('Ticket', ticket_data, ['id'])
new_ticket_url = SERVER_PATH + "/detail/Ticket/" + str(sg_ticket['id'])
QDesktopServices.openUrl( QUrl(new_ticket_url) )
示例3: addSrc
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
def addSrc():
repo = '/mnt/karramba'
shotFoldList = ['anim', 'comp', 'data', 'fx', 'light', 'out', 'src', 'tmp']
seqFoldList = ['anim', 'comp', 'data', 'fx', 'light', 'out', 'shots']
dataFoldList = ['cache', 'geo', 'render', 'shadowmap', 'sim', 'track', 'photonmap']
outFoldList = ['dailies', 'hires']
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'addSrc'
scriptKey = 'd7dac4e2c55faf486875dfb944ffc9d8e49a0c44'
sg = Shotgun(site, scriptName, scriptKey)
projList = sg.find('Project', [], ['name'])
for i in projList:
print 'id:' + str(i['id']) + ' ' + i['name']
prId = int(raw_input('Print project id:'))
proj = sg.find_one('Project', [['id','is',prId]], ['name'])
if not [x for x in os.listdir(repo) if x==proj['name']]:
print "Project doesn't exist in repository"
return
s = os.sep
prPath = repo + s + proj['name']
seqPath = prPath + s + 'film' + s + 'sequences'
seqList = os.listdir(prPath + s + 'src')
for i in seqList:
sequenceFold = prPath + s + 'film' + s + 'sequences'
os.makedirs(sequenceFold + s + i)
for j in seqFoldList:
os.makedirs(sequenceFold + s + i + s + j)
for d in dataFoldList:
os.makedirs(sequenceFold + s + i + s + 'data' + s + d)
for o in outFoldList:
os.makedirs(sequenceFold + s + i + s + 'out' + s + o)
shList = os.listdir(prPath + s + 'src' + s + i)
for sh in shList:
shFold = sequenceFold + s + i + s + 'shots'
os.makedirs(shFold + s + sh)
for f in shotFoldList:
os.makedirs(shFold + s + sh + s + f)
for ds in dataFoldList:
os.makedirs(shFold + s + sh + s + 'data' + s + ds)
for ot in outFoldList:
os.makedirs(shFold + s + sh + s + 'out' + s + ot)
shutil.move(prPath + s + 'src' + s + i + s + sh, shFold + s + sh + s + 'src')
os.system('ln -sf ' + shFold + s + sh + s + 'src ' + prPath + s + 'src' + s + i + s + sh)
示例4: _get_projects_list
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
def _get_projects_list():
sg = Shotgun('http://yoursite.com', 'your_api', '123456')
filters = [['sg_status', 'is', 'Active'], ['tank_name', 'is_not', '']]
fields = ['name']
order = [{'field_name': 'name', 'direction': 'asc'}]
projectsDic = sg.find('Project', filters, fields, order)
newProjectsDic = []
for project in projectsDic:
newProjectsDic.append(project['name'].replace(' ', ''))
return newProjectsDic
示例5: getAllProjects
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
def getAllProjects():
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'AssetBrowser'
scriptKey = 'c35ab5f5322d4b1e8b6488bb315c03e5f38881ea'
sg = Shotgun(site, scriptName, scriptKey)
fields = ['id','name','type']
projects= sg.find("Project",[],fields)
if len(projects) < 1:
print "couldn't find any projects"
#exit(0)
else:
print "Found "+str(len(projects))+" projects"
# pprint (projects)
return projects
示例6: getShotsBySeqId
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
def getShotsBySeqId(seq_id):
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'AssetBrowser'
scriptKey = 'c35ab5f5322d4b1e8b6488bb315c03e5f38881ea'
sg = Shotgun(site, scriptName, scriptKey)
fields = ['id','type','code']
filters = [['sg_sequence','is',{'type':'Sequence','id':seq_id}]]
shots= sg.find("Shot",filters,fields)
if len(shots) < 1:
print "couldn't find any shots"
#exit(0)
else:
None
return shots
示例7: setupLightFiles
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
def setupLightFiles(cb010 = True, cb020 = True, cb030 = True, cb040 = True, cb050 = True, cb060 = True, optimizeEnv = True, rippleLyr = True, bgHillLyr = True, directory = 'I:/bubblebathbay/episodes', episode = 152, shots = 1):
## Initialize Shotgun API
base_url = "http://bubblebathbay.shotgunstudio.com"
script_name = 'audioUploader'
api_key = 'bbfc5a7f42364edd915656d7a48d436dc864ae7b48caeb69423a912b930bc76a'
sgsrv = Shotgun(base_url = base_url , script_name = script_name, api_key = api_key, ensure_ascii = True, connect = True)
## Query data from Shotgun
data = sgsrv.find('Shot', filters = [["code", "contains", 'ep%s_sh' % episode]], fields = ['code', 'sg_cut_in', 'sg_cut_out', 'sg_tod', 'sg_ocean_type'])
if data:
if episode:
if shots:
for each in data:
if each['code'].split('_')[-1].strip('sh') in shots:
try:
cmds.refresh(suspend = True)
get_data_from_shotgun(cb010 = cb010, cb020 = cb020, cb030 = cb030, cb040 = cb040, cb050 = cb050, cb060 = cb060, optimizeEnv = optimizeEnv, rippleLyr = rippleLyr, bgHillLyr = bgHillLyr, directory = directory, **each)
except:
pass
finally:
cmds.refresh(suspend = False)
示例8: disk
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
# first do the studio location tank.bat
studio_tank_bat = os.path.abspath(os.path.join(tank_install_root, "..", "tank.bat"))
if os.path.exists(studio_tank_bat):
log.info("Updating %s..." % studio_tank_bat)
try:
this_folder = os.path.abspath(os.path.join( os.path.dirname(__file__)))
new_tank_bat = os.path.join(this_folder, "setup", "root_binaries", "tank.bat")
log.debug("copying %s -> %s" % (new_tank_bat, studio_tank_bat))
shutil.copy(new_tank_bat, studio_tank_bat)
os.chmod(studio_tank_bat, 0775)
except Exception, e:
log.error("\n\nCould not upgrade core! Please contact support! \nError: %s" % e)
pcs = sg.find("PipelineConfiguration", [], ["code", "project", "windows_path", "mac_path", "linux_path"])
for pc in pcs:
try:
log.info("Processing Pipeline Config %s (Project %s)..." % (pc.get("code"),
pc.get("project").get("name")))
local_os_path = pc.get(SG_LOCAL_STORAGE_OS_MAP[sys.platform])
if local_os_path is None:
log.info("No pipeline configurations registered for this OS. Skipping...")
continue
if not os.path.exists(local_os_path):
log.info("Pipeline Config does not exist on disk (%s) - skipping..." % local_os_path)
示例9: cout
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
progressBar.setValue(100)
progressBar.setFormat("Computing done")
logLabel.setText(outputText.replace(" "," "))
cout("done : " + str (ev) )
f.write("</dir></body></html>")
f.close()
datafileName = "c:/temp/EVENTLOG/eventManager_"+projectId["name"]+"_"+ today +".pkl"
displayDataContext_perDay( workstationDict, projectId["name"], datafileName )
if __name__ == '__main__':
SERVER_PATH = "https://nozon.shotgunstudio.com"
SCRIPT_NAME = 'noteManager'
SCRIPT_KEY = '3fbb2a5f180457af709fcad231c96ac8a916711427af5a06c47eb1758690f6e4'
import sys
sys.path.append("Z:/Dev/cyril/python/PACKAGES")
from shotgun_api3 import Shotgun
sg = Shotgun(SERVER_PATH, SCRIPT_NAME, SCRIPT_KEY)
projetcLit = sg.find("Project", [], ["name"])
for projectContext in projetcLit :
print "\n\n###########\tPROJECT\t############\n\t\t" , projectContext["name"], projectContext["id"]
launch(None, None, [] , None, projectContext, sg )
示例10: dMFXsubmitterDialog
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
class dMFXsubmitterDialog(QDialog, Ui_dMFXsubmitter):
def __init__(self, parent = None):
# set up the UI and variable here - don't forget to call updateUI at end
super(dMFXsubmitterDialog,self).__init__(parent)
self.acceptDrops()
self.setupUi(self) # generic call to setup the Ui provided by Qt
self.password = ''
self.version_file_path = ''
self.user = ''
self.user_id = ''
self.user_name = ''
self.user_initials = ''
self.submit_movie = False
self.movie_file_path = ''
self.description = ''
self.login_status = False
self.allOK = True
self.submit_call_track = True
self.version_type = 'Shot'
self.created_version_id = None
self.sg = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
self.sgu = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
self.users_with_initals = INITIALS_LIST
self.user_list = []
self.lineEdit_versionFile.dragEnterEvent = types.MethodType(dragEnterEvent,self.lineEdit_versionFile)
self.lineEdit_versionFile.dropEvent = types.MethodType(dropEvent,self.lineEdit_versionFile)
self.lineEdit_versionFile.setAcceptDrops(True)
self.lineEdit_versionFile.setDragEnabled(True)
self.lineEdit_forReview.dragEnterEvent = types.MethodType(dragEnterEvent,self.lineEdit_forReview)
self.lineEdit_forReview.dropEvent = types.MethodType(dropEvent,self.lineEdit_forReview)
self.lineEdit_forReview.setAcceptDrops(True)
self.lineEdit_forReview.setDragEnabled(True)
# start things happening... get the users from sg and populate them into the drop-down
self.update_user_list()
self.connect(self,SIGNAL('update'),self.updateUI)
self.new_value = 'this is not a new value'
#self.emit(SIGNAL("update"))
self.updateUI()
def update_user_list(self):
filters = [ ['sg_status_list', 'is', 'act' ],]
fields = ['name', 'login']
users = self.sg.find('HumanUser', filters, fields)
user_list = [ (user['name'],user['login'],user['id']) for user in users if user['name'] != 'Template User']
user_list.sort()
self.user_list = user_list
self.comboBox_artistSelect.addItem('Please Select...')
self.user = 'Please Select...'
for user in user_list:
self.comboBox_artistSelect.addItem(user[0])
self.updateUI()
def reset_to_go_again(self):
# todo set all fields to blank, not just update the values...
self.version_file_path = ''
self.submit_movie = False
self.movie_file_path = ''
self.description = ''
self.allOK = True
self.created_version_id = None
self.plainTextEdit_description.setPlainText('')
self.lineEdit_versionFile.setText('')
self.lineEdit_forReview.setText('')
self.updateUI()
def updateUI(self):
# make sure that the UI is updated to match input
self.activateWindow() # window gets keyboard focus after redraw
self.allOK = True
self.description = str(self.plainTextEdit_description.toPlainText())
# check user and if it needs initials, activate the text box
if self.user in self.users_with_initals:
self.lineEdit_initials.setEnabled(True)
else:
self.lineEdit_initials.setEnabled(False)
# check user to see if one has been selected... set login to default if it has and there is no login set
if self.user == STARTING_USER_LIST_TEXT:
self.pushButton_login.setEnabled(False)
else:
self.pushButton_login.setEnabled(True)
if not self.login_status:
self.pushButton_login.setDefault(True)
# check to see if logged in - if not, disable everything below login
if self.login_status:
self.label_password.setText("** Logged In **")
self.pushButton_login.setEnabled(False)
self.comboBox_artistSelect.setEnabled(False)
else:
self.label_password.setText("Shotgun Password")
self.pushButton_login.setEnabled(True)
# check the submit checkbox and enable fields if set
if self.checkBox_forReview.isChecked():
self.lineEdit_forReview.setEnabled(True)
#.........这里部分代码省略.........
示例11: Shotgun
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
SCRIPT_USER = "********" # your script name
SCRIPT_KEY = "********" # your key here
CURRENT_VERSION_FIELD = "********" # get this from the "Configure Field" dialog in shotgun
sg = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
fields = ["id", "entity", "sg_asset_type"] # version id, shot info, "version"
# sg_current_version field to upate
# TEST VALUES TO BE SET BY POST FROM ACTION MENU
version_ids = [19, 20, 93] # replace with result from the post
project_id = 64 # Replace this with the result from the post
for a_version_id in version_ids:
filters = [["project", "is", {"type": "Project", "id": project_id}], ["id", "is", a_version_id]]
assets = sg.find("Version", filters, fields)
if len(assets) < 1:
print "couldn't find any assets"
exit(0)
else:
for an_asset in assets:
entity_type = an_asset["entity"]["type"] # should always be 'Shot'!
if entity_type == "Shot": # we always expect a shot but OK to test
shot_id = an_asset["entity"]["id"]
linked_version = {"type": "Version", "id": a_version_id}
data = {CURRENT_VERSION_FIELD: linked_version}
changed_asset = sg.update("Shot", shot_id, data)
pprint(changed_asset)
else:
print ("version %s is linked to something other than a shot?" % a_version_id)
示例12: API
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
form = cgi.FieldStorage()
# Get data from fields
selected_ids_str = form.getvalue('selected_ids')
form_project_id = form.getvalue('project_id')
# and convert to values that can be used by Shotgun API (list and ints)
version_ids=[int(x) for x in selected_ids_str.split(',')] # list of ints from a string
project_id =int(form_project_id) # integer from string
success = True # keep track of errors so that true success for all requests can be reported to the user
filters = [
['project','is',{'type':'Project','id':project_id}],
['id', 'in' ] + version_ids ,
]
versions= sg.find("Version",filters,fields)
found_shots = set() # a set to hold all of the found shots so we can error if we need to...
for a_version in versions: #pre-process all shots looking for duplicates
print "</br>"
if a_version['entity']['name'] in found_shots:
raise MultiShotError(
'There is more than one version of shot %s in your request' % a_version['entity']['name'] )
else:
found_shots.add( a_version['entity']['name'] )
for a_version in versions: # re-process all shots to set the current version field correctly
entity_type = a_version['entity']['type'] # should always be 'Shot'!
if entity_type == 'Shot': # we always expect a shot but OK to test
shot_id = a_version['entity']['id']
linked_version = { 'type' : 'Version' , 'id' : a_version['id'] }
开发者ID:ProjectGuerilla,项目名称:Shotgun-Code-Snippets,代码行数:33,代码来源:set_current_version_posthandler_cgi.py
示例13: MainUI
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
class MainUI(QtGui.QWidget):
def __init__(self, app):
"""
main UI for STATIC ENV handling
I always build my UI in __init__ so suck it up..
"""
QtGui.QWidget.__init__(self)
self.app = app
self.fileBoxes = []
## Instance the api for talking directly to shotgun.
base_url = "http://bubblebathbay.shotgunstudio.com"
script_name = 'audioUploader'
api_key = 'bbfc5a7f42364edd915656d7a48d436dc864ae7b48caeb69423a912b930bc76a'
self.sgsrv = Shotgun(base_url = base_url , script_name = script_name, api_key = api_key, ensure_ascii=True, connect=True)
self.shotNum = self._getShotNum()[0]
self.currentENV = self._getShotNum()[1]
debug(self.app, method = 'MainUI', message = 'self.shotNum: %s' % self.shotNum, verbose = False)
debug(self.app, method = 'MainUI', message = 'self.currentENV: %s' % self.currentENV, verbose = False)
self.lightAlembicFolder = 'I:/lsapipeline/episodes/ep000/%s/Light/publish/alembic_static' % self.shotNum
## Now build the UI
self.mainLayout = QtGui.QHBoxLayout(self)
self.leftSideLayout = QtGui.QVBoxLayout(self)
debug(self.app, method = 'MainUI', message = 'self.mainLayout built...', verbose = False)
##########################
### ENV SELECTION PULLDOWN
self.envLayout = QtGui.QVBoxLayout(self)
self.envPulldown = QtGui.QComboBox()
getENVS = self.sgsrv.find('Asset', filters = [["code", "contains", 'ENV_'], ["code", "not_contains", '_ENV_'], ["code", "not_contains", 'WORLDMAP'], ["code", "not_contains", 'TSETbuild']], fields=['code'])
debug(self.app, method = 'MainUI', message = 'getENVS: %s' % getENVS, verbose = False)
if self.shotNum:
for each in getENVS:
if each['code'] == self.currentENV:
self.envPulldown.addItem(each['code'])
self.lightAlembicFolder = 'I:/lsapipeline/episodes/ep000/%s/Light/publish/alembic_static' % self.shotNum
self.envPulldown.setCurrentIndex(self.envPulldown.findText(self.currentENV))
debug(self.app, method = 'MainUI', message = 'self.envPulldown setCurrentIndex...', verbose = False)
else:
for each in getENVS:
if 'STATIC' in each['code']:
self.envPulldown.addItem(each['code'])
self.fetchAssetListButton = QtGui.QPushButton(Icon('refresh.png'), 'Fetch Asset List')
self.fetchAssetListButton.setStyleSheet("QPushButton {text-align : left}")
self.fetchAssetListButton.released.connect(self._fetchAssetList)
debug(self.app, method = 'MainUI', message = 'self.fetchAssetListButton built...', verbose = False)
self.importAssetButton = QtGui.QPushButton(Icon('alembic.png'), 'Import latest Pub ABC for Sel')
self.importAssetButton.setStyleSheet("QPushButton {text-align : left}")
self.importAssetButton.released.connect(self._fetchMDLAlembicPublish)
debug(self.app, method = 'MainUI', message = 'self.importAssetButton built...', verbose = False)
self.checkMDLButton = QtGui.QPushButton(Icon('refresh.png'), 'Check For MDL ABC Publishes')
self.checkMDLButton.setStyleSheet("QPushButton {text-align : left}")
self.checkMDLButton.released.connect(self._checkVersionsAgainstPublishes)
debug(self.app, method = 'MainUI', message = 'self.checkMDLButton built...', verbose = False)
self.redoSetsButton = QtGui.QPushButton(Icon('plus.png'), 'ReDo Set Assignments')
self.redoSetsButton.setStyleSheet("QPushButton {text-align : left}")
self.redoSetsButton.released.connect(self._createSets)
debug(self.app, method = 'MainUI', message = 'self.redoSetsButton built...', verbose = False)
self.checkSRFXMLButton = QtGui.QPushButton(Icon('refresh.png'), 'Check For SRF Publishes')
self.checkSRFXMLButton.setStyleSheet("QPushButton {text-align : left}")
self.checkSRFXMLButton.released.connect(self._checkSRFVersionsAgainstPublishes)
self.cleanDuplicateCoresButton = QtGui.QPushButton(Icon('AssignedFileIt.png'), 'Clean Duplicate Cores')
self.cleanDuplicateCoresButton.setStyleSheet("QPushButton {text-align : left}")
self.cleanDuplicateCoresButton.released.connect(self._fixTheFuckingCores)
self.cleanDuplicateCoresButton.setToolTip('This is performed on every import of an static env via the multiloader.\n Exposed just in case you need to run this manually.\n This will go through a scene with multiple static ENVs in it \nand try to make sure duplicate cores are renering correctly.')
self.removeCoreGrpsButton = QtGui.QPushButton(Icon('skull.png'), 'Remove old Core Grps under geo_hrc')
self.removeCoreGrpsButton.setStyleSheet("QPushButton {text-align : left}")
self.removeCoreGrpsButton.released.connect(self._removeCoreGrps)
self.removeCoreGrpsButton.setToolTip('You can use this to clean up any old core grps under the geo_hrc grps in a scene\nafer you have done a core archive rebuild from xml...')
## THIS IS UP TO YOU TO ENABLE. IT SHOULDNT BE REQUIRED AS THE MDL PUBLISH SHOULD NOW BE EXPORTING THE CORRECT ATTRS FOR ALEMBIC
self.republishALL = QtGui.QPushButton('Republish ALL MDL Alembics for %s' % self.currentENV)
self.republishALL.released.connect(self._republishAllAlembicsForENV)
self.republishALL.setEnabled(True)
self.lambert1Button = QtGui.QPushButton(Icon('refresh.png'), 'Check lambert1 objects')
self.lambert1Button.setStyleSheet("QPushButton {text-align : left}")
self.lambert1Button.released.connect(self._lambert1Object)
self.caNSclashCheckButton = QtGui.QPushButton(Icon('refresh.png'), 'Check Core Archive Namespace')
self.caNSclashCheckButton.setStyleSheet("QPushButton {text-align : left}")
self.caNSclashCheckButton.released.connect(self.coreArchiveNSclashCheck)
self.checkFileInPathButton = QtGui.QPushButton(Icon('refresh.png'), 'Check Invalid FileIn Path')
self.checkFileInPathButton.setStyleSheet("QPushButton {text-align : left}")
self.checkFileInPathButton.released.connect(self.checkFileInPath)
self.checkNonManifoldButton = QtGui.QPushButton(Icon('refresh.png'), 'Check Non-Manifold Geometry')
#.........这里部分代码省略.........
示例14: Shotgun
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
SCRIPT_USER = 'mail-gateway'
SCRIPT_KEY = '987fd62624610c1580c070441f1ae208653541f9'
sg = Shotgun(SERVER_PATH, SCRIPT_USER, SCRIPT_KEY)
M = imaplib.IMAP4_SSL('imap.gmail.com', 993)
M.login('[email protected]', 'PASSWORD')
M.select("eng-support") # mailbox/tag name
typ, data = M.search(None, 'ALL')
for num in data[0].split():
typ, msgdata = M.fetch(num, '(RFC822)')
#print 'Message %s\n%s\n' % (num, data[0][1])
msg_dict = parse.parse(msgdata[0][1])
print "message from %s" % msg_dict["from"]
people = sg.find("HumanUser",[['email','is',msg_dict["from"]]],['id','name'])
if len(people) < 1:
print "couldn't find user"
else:
# if we find a valid user, create a ticket for them
user = people[0]
ticket_data = {
'created_by': {'type':'HumanUser','id':user['id']},
'addressings_to': [{'type':'Group','id':5}],
'title': msg_dict['subject'],
'description': msg_dict['body'],
'project': {'type':'Project', 'id':178},
}
sg.create('Ticket', ticket_data, return_fields=['id'])
# if we made it this far the e-mail was processed, now delete it
示例15: Shotgun
# 需要导入模块: from shotgun_api3 import Shotgun [as 别名]
# 或者: from shotgun_api3.Shotgun import find [as 别名]
#from dBase import *
from shotgun_api3 import Shotgun
import os
site = 'https://chimneypot.shotgunstudio.com'
scriptName = 'dBase'
scriptKey = '729a76955455909c79f6d90262bb9fbe9186b92b'
pName = 'kievPipelineTest'
sg = Shotgun(site, scriptName, scriptKey)
lst = sg.find('HumanUser', [['updated_at', 'not_in_last', 1, 'MONTH'],['sg_status_list', 'is', 'act']], ['name', 'updated_at', 'sg_status_list'])
for i in lst:
print "%s: %s, %s, %s"%(i['name'],i['updated_at'], i['sg_status_list'], i['id'])
killEric = sg.update('HumanUser', 62, {'sg_status_list':'dis'})
def test():
print 'huy'
return sg