本文整理汇总了Python中aspose.cloud.common.utils.Utils.sign方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.sign方法的具体用法?Python Utils.sign怎么用?Python Utils.sign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aspose.cloud.common.utils.Utils
的用法示例。
在下文中一共展示了Utils.sign方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_shapes
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def get_shapes(self, slide_number,storage_type = None,storage_name =None,folder=None):
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/slides/" + self.file_name + "/slides/" + str(slide_number) + "/shapes"
if folder is not None:
str_uri += "?folder=" + folder
if storage_name is not None:
str_uri += "&storage=" + storage_name
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "GET", "", "")
json_data = json.loads(response_stream)
shapes = {}
if json_data["Code"] == 200:
shape = {}
for json_data["ShapeList"]["Links"] in shape:
signed_uri = Utils.sign(Utils(), shape["Uri"]["Href"])
response_stream = Utils.process_command(Utils(), signed_uri, "GET", "", "")
data = json.loads(response_stream)
shapes = data
return shapes
else:
return json_data
except:
raise
示例2: save
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def save(self, codeText, symbology, imageFormat, xResolution, yResolution, xDimension, yDimension):
strURI = Product.base_product_uri + "/barcode/generate?text=" + codeText + "&type=" + str(symbology) + "&format=" + imageFormat
if xResolution <= 0:
strURI += ""
else:
strURI += "&resolutionX=" + str(xResolution)
if yResolution <= 0:
strURI += ""
else:
strURI += "&resolutionY=" + str(yResolution)
if xDimension <= 0:
strURI += ""
else:
strURI += "&dimensionX=" + str(xDimension)
if yDimension <= 0:
strURI += ""
else:
strURI += "&dimensionY=" + str(yDimension)
try:
signedURI = Utils.sign(Utils(), strURI)
response = Utils.process_command(Utils(), signedURI, "GET", "", "")
v_output = Utils.validate_output(self, response)
if(v_output == ""):
output_path = AsposeApp.output_location + "barcode" + str(symbology) + "." + imageFormat
Utils.save_file(self, response, output_path)
return output_path
except:
raise
示例3: replace_text
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def replace_text(self, *args):
num_of_args = len(args)
if(num_of_args == 2):
old_text = args[0]
new_text = args[1]
elif(num_of_args == 3):
old_text = args[0]
new_text = args[1]
slide_number = args[2]
else:
raise Exception("Invalid Numbers of Arguments")
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/slides/" + self.file_name
if num_of_args == 3:
str_uri += "/slides/" + str(slide_number)
str_uri += "/replaceText?oldValue=" + old_text + "&newValue=" + new_text + "&ignoreCase=true"
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "POST", "JSON", "")
json_data = json.loads(response_stream)
if json_data["Code"] == 200:
return str(json_data["Matches"]) + " Found And Replaced"
else:
return False
except:
raise
示例4: replace_text
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def replace_text(self, file_name, old_value, new_value, is_match_case, is_match_whole_word):
try:
if file_name == "":
raise Exception("Please Specify File Name")
field_arr = {
"OldValue": old_value,
"NewValue": new_value,
"IsMatchCase": str(is_match_case),
"IsMatchWholeWord": str(is_match_whole_word),
}
json_arr = json.dumps(field_arr)
str_uri = Product.base_product_uri + "/words/" + file_name + "/replaceText"
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "POST", "json", json_arr)
v_output = Utils.validate_output(Utils(), response_stream)
if v_output == "":
folder = Folder()
output_stream = folder.get_file(file_name)
output_path = AsposeApp.output_location + file_name
Utils.save_file(Utils(), output_stream, output_path)
return output_path
else:
return v_output
except:
raise
示例5: convert_local_file
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def convert_local_file(self, input_filename, output_filename, output_format):
try:
if input_filename == "":
raise Exception("Please Specify Local File Name")
if output_filename == "":
raise Exception("Please Specify Output File Name")
if output_format == "":
raise Exception("Please Specify Output Format")
str_uri = Product.base_product_uri + "/words/convert?format=" + output_format
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.upload_file_binary(Utils(), signed_uri, input_filename, "xml")
v_output = Utils.validate_output(Utils(), response_stream)
if v_output == "":
if output_format == "html":
save_format = "zip"
else:
save_format = output_format
if output_filename == "":
output_path = AsposeApp.output_location + Utils.get_filename(Utils(), input_filename) + "." + save_format
else:
output_path = AsposeApp.output_location + output_filename + "." + save_format
Utils.save_file(Utils(), response_stream, output_path)
return output_path
else:
return v_output
except:
raise
示例6: replace_text
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def replace_text(self, *args):
num_of_args = len(args)
if num_of_args == 2:
old_text = args[0]
new_text = args[1]
elif num_of_args == 3:
worksheet_name = args[0]
old_text = args[1]
new_text = args[2]
else:
raise Exception("Wrong Numbers of Arguments")
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/cells/" + self.file_name
if num_of_args == 3:
str_uri += "/worksheet/" + worksheet_name
str_uri += "/replaceText?oldValue=" + old_text + "&newValue=" + new_text
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "POST", "", "")
v_output = Utils.validate_output(Utils(), response_stream)
if v_output == "":
folder = Folder()
output_stream = folder.get_file(self.file_name)
output_path = AsposeApp.output_location + self.file_name
Utils.save_file(Utils(), output_stream, output_path)
return output_path
else:
return v_output
except:
raise
示例7: insert_watermark_image
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def insert_watermark_image(self, file_name, image_filename, rotation_angle):
try:
if file_name == "":
raise Exception("Please Specify File Name")
if image_filename == "":
raise Exception("Please Specify Image File Name")
str_uri = (
Product.base_product_uri
+ "/words/"
+ file_name
+ "/insertWatermarkImage?imageFile="
+ image_filename
+ "&rotationAngle="
+ str(rotation_angle)
)
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "POST", "json", "")
v_output = Utils.validate_output(Utils(), response_stream)
if v_output == "":
folder = Folder()
output_stream = folder.get_file(file_name)
output_path = AsposeApp.output_location + file_name
Utils.save_file(Utils(), output_stream, output_path)
return output_path
else:
return v_output
except:
raise
示例8: convert_local_file
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def convert_local_file(self, input_file, output_filename, output_format):
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
if input_file == "":
raise Exception("Please Specify Input File Along With Path")
if output_filename == "":
raise Exception("Please Specify Output File Name")
if output_format == "":
raise Exception("Please Specify Output Format")
str_uri = Product.base_product_uri + "/pdf/convert?format=" + output_format
if os.path.exists(input_file) == False:
raise Exception("Input File Does not Exists")
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.upload_file_binary(Utils(), signed_uri, input_file)
v_output = Utils.validate_output(Utils(), response_stream)
if v_output == "":
if self.save_format == "html":
save_format = "zip"
else:
save_format = output_format
if output_filename == "":
output_path = AsposeApp.output_location + Utils.get_filename(Utils(), input_file) + "." + save_format
else:
output_path = AsposeApp.output_location + output_filename + "." + save_format
Utils.save_file(Utils(), response_stream, output_path)
return output_path
else:
return v_output
except:
raise
示例9: get_image_count
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def get_image_count(self, page_number):
try:
if self.file_name == "":
raise Exception("Please Specify Pdf File")
str_uri = Product.base_product_uri + "/pdf/" + self.file_name + "/pages/" + str(page_number) + "/images"
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "GET", "", "")
json_data = json.loads(response_stream)
return len(json_data["Images"]["List"])
except:
raise
示例10: get_mailmerge_field_names
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def get_mailmerge_field_names(self, file_name):
try:
if file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/words/" + file_name + "/mailMergeFieldNames"
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "GET" , "", "")
json_data = json.loads(response_stream)
return json_data["FieldNames"]
except:
raise
示例11: is_child_bookmark
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def is_child_bookmark(self, bookmark_index):
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/pdf/" + self.file_name + "/bookmarks/" + str(bookmark_index)
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "GET", "", "")
json_data = json.loads(response_stream)
return json_data["Bookmark"]
except:
raise
示例12: get_child_bookmark_count
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def get_child_bookmark_count(self, parent_index):
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/pdf/" + self.file_name + "/bookmarks/" + str(parent_index) + "/bookmarks"
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "GET", "", "")
json_data = json.loads(response_stream)
return len(json_data["Bookmarks"]["List"])
except:
raise
示例13: get_annotation
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def get_annotation(self, page_number, annotation_index):
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/pdf/" + self.file_name + "/pages/" + str(page_number) + "/annotations/" + str(annotation_index)
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "GET", "", "")
json_data = json.loads(response_stream)
return json_data["Annotation"]
except:
raise
示例14: get_attachment
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def get_attachment(self, attachment_index):
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/pdf/" + self.file_name + "/attachments/" + str(attachment_index)
signed_uri = Utils.sign(Utils(), str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "GET", "", "")
json_data = json.loads(response_stream)
return json_data["Attachments"]
except:
raise
示例15: convert
# 需要导入模块: from aspose.cloud.common.utils import Utils [as 别名]
# 或者: from aspose.cloud.common.utils.Utils import sign [as 别名]
def convert(self):
try:
if self.file_name == "":
raise Exception("Please Specify File Name")
str_uri = Product.base_product_uri + "/slides/" + self.file_name + "?format=" + self.save_format
signed_uri = Utils.sign(self, str_uri)
response_stream = Utils.process_command(Utils(), signed_uri, "GET", "", "")
output_path = AsposeApp.output_location + Utils.get_filename(Utils(), self.file_name) + "." + self.save_format
Utils.save_file(Utils(), response_stream, output_path);
return output_path
except:
raise