本文整理匯總了Python中Files.getRootDir方法的典型用法代碼示例。如果您正苦於以下問題:Python Files.getRootDir方法的具體用法?Python Files.getRootDir怎麽用?Python Files.getRootDir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Files
的用法示例。
在下文中一共展示了Files.getRootDir方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: makeAsset2Shot
# 需要導入模塊: import Files [as 別名]
# 或者: from Files import getRootDir [as 別名]
def makeAsset2Shot(idx, typecode=None, statcode=None ):
""" 선택한 에셋들에 대한 부모 샷을 만들고 서브로 링크 """
cnt = 0
if (type(idx) == str) and "," in idx:
idxList = idx.split(",")
else:
idxList = [idx,]
for nIDX in idxList:
assetData = Archive("Asset").getValues(idx, "Parent1,Name,Thumb,Preview,ScanEdgeCode,ScanDuration")
shotSave = {
"Parent1": assetData["Parent1"],
"Name" : assetData["Name"],
"Thumb": Files.getRootDir() + assetData["Thumb"],
"Preview": assetData["Preview"],
"Duration": assetData["ScanDuration"]
}
if statcode: shotSave["StatCode"] = statcode
if typecode: shotSave["TypeCode"] = typecode
shot_IDX = Archive("Shot").New(**shotSave)
r = Archive("Shot").addLink(shot_IDX, "Asset", idx)
if (r > 0):
cnt += 1
return cnt
示例2: ThumbInsert
# 需要導入模塊: import Files [as 別名]
# 或者: from Files import getRootDir [as 別名]
def ThumbInsert(arg, extra):
idx = extra["idx"]
modifyData = { "IDX": idx, "_pass_":True, "useSpartaDir": True }
# 샷 정보 가져오기
shotData = get( idx, "Shot.Parent1,Shot.Parent2,Project.Code,Seq.TypeCode,Shot.TypeCode,Shot.Thumb")
# 기존 썸네일이 있으면 삭제
oldThumbPath = os.path.join(Files.getRootDir(), shotData["Thumb"][1:])
if os.path.exists(oldThumbPath):
os.unlink(oldThumbPath)
pData = {
"Project.Code": shotData["Project.Code"],
"Seq.TypeCode": shotData["Seq.TypeCode"],
"Shot.TypeCode": shotData["TypeCode"],
"Shot.Code": Naming.ApplyWithQuery("Shot.Code", idx, **arg )
}
if "Thumb" in arg: modifyData["Thumb"] = arg["Thumb"]
Files.CopyThumb2Naming( "Shot.Thumb", idx, inArg=modifyData, preData=pData )
edit( idx, **modifyData )
return arg
示例3: sendMessage
# 需要導入模塊: import Files [as 別名]
# 或者: from Files import getRootDir [as 別名]
def sendMessage( receiver, subject, content, attachments=None, withSMS=None ):
""" 쪽지함에 쪽지를 발송
"""
#[TODO] To,CC,BCC에 대한 처리 필요
#[TODO] IF not logined !!
smsList = []
msgIDXs = []
msgSave = { "Subject": subject, "Content": content, "Sender": Login.getID(), "SenderName": Login.getName() }
if "<" in receiver:
#ex) Address Parsing :: "정기영" <[email protected]>, "김태희" <[email protected]> -> ["[email protected]", "[email protected]"]
addrsList = re.findall("\<([._,a-zA-Z0-9:\#\@]+)\>+", receiver)
else:
addrsList = [n.strip() for n in receiver.split(",")]
for recID in addrsList:
userData = Archive("User").getValues( "User.UserID == "+ recID, "Name,HandPhone" )
if userData:
msgSave["Receiver"] = recID
result_IDX = Archive("MsgInBox").New(**msgSave)
if result_IDX:
msgIDXs.append( result_IDX )
if userData["HandPhone"] and not userData["HandPhone"].replace("-","") in smsList:
smsList.append( str(userData["HandPhone"].replace("-","")) )
sentMsg = { "RelateIDX": result_IDX, "Subject": subject, "Content": content, "Receiver": recID, "ReceiverName": userData["Name"], "Sender": Login.getID() }
r = Archive("MsgSent").New( **sentMsg )
if attachments:
#[TODO] 임시 코드입니다. 멀티센딩에서 업된 파일에 대한 레퍼런스 카운트가 이상적이나 일단 그냥 복제형태로 갑니다.
if type(attachments) == unicode:
attachments = attachments.encode("utf8")
uploadFile = Files.getRootDir() + attachments
fileName = os.path.split(attachments)[1]
if os.path.exists( uploadFile ):
for ridx in msgIDXs:
if str(ridx).isdigit():
targetFile = "/data/message/%s.%s" % ( fileName, ridx )
shutil.copy2( uploadFile, Files.getSpartaDir() + targetFile )
msgMod = { "IDX" : ridx, "Attachments" : "%s" % fileName }
r = Archive( "MsgInBox" ).New( **msgMod )
os.remove(uploadFile)
if withSMS and smsList:
SMS.send( sendMsg=u"스팔타쪽지>"+msgSave["Subject"], recvList=smsList )
return len(msgIDXs)
示例4: getRootDir
# 需要導入模塊: import Files [as 別名]
# 或者: from Files import getRootDir [as 別名]
def getRootDir():
return Files.getRootDir()