本文整理汇总了Python中cybox.objects.email_message_object.EmailMessage.subject方法的典型用法代码示例。如果您正苦于以下问题:Python EmailMessage.subject方法的具体用法?Python EmailMessage.subject怎么用?Python EmailMessage.subject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cybox.objects.email_message_object.EmailMessage
的用法示例。
在下文中一共展示了EmailMessage.subject方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_namespaces
# 需要导入模块: from cybox.objects.email_message_object import EmailMessage [as 别名]
# 或者: from cybox.objects.email_message_object.EmailMessage import subject [as 别名]
def test_get_namespaces(self):
m = EmailMessage()
m.to = "[email protected]"
m.subject = "Here's a cool picture"
m.links = Links()
u = URI("http://example.com/cool.jpg", URI.TYPE_URL)
m.links.append(u.parent.id_)
self.assertEqual(5, len(Observables([u, m])._get_namespaces()))
示例2: main
# 需要导入模块: from cybox.objects.email_message_object import EmailMessage [as 别名]
# 或者: from cybox.objects.email_message_object.EmailMessage import subject [as 别名]
def main():
m = EmailMessage()
m.from_ = ["[email protected]",
"[email protected]",
"[email protected]"]
m.from_.condition = "Equals"
m.subject = "New modifications to the specification"
m.subject.condition = "Equals"
print(Observables(m).to_xml())
示例3: main
# 需要导入模块: from cybox.objects.email_message_object import EmailMessage [as 别名]
# 或者: from cybox.objects.email_message_object.EmailMessage import subject [as 别名]
def main():
NS = cybox.utils.Namespace("http://example.com/", "example")
cybox.utils.set_id_namespace(NS)
m = EmailMessage()
m.from_ = ["[email protected]",
"[email protected]",
"[email protected]"]
m.from_.condition = "Equals"
m.subject = "New modifications to the specification"
m.subject.condition = "Equals"
print(Observables(m).to_xml())
示例4: main
# 需要导入模块: from cybox.objects.email_message_object import EmailMessage [as 别名]
# 或者: from cybox.objects.email_message_object.EmailMessage import subject [as 别名]
def main():
NS = cybox.utils.Namespace("http://example.com/", "example")
cybox.utils.set_id_namespace(NS)
m = EmailMessage()
m.to = ["[email protected]", "[email protected]"]
m.from_ = "[email protected]"
m.subject = "New modifications to the specification"
a = Address("192.168.1.1", Address.CAT_IPV4)
m.add_related(a, "Received_From", inline=False)
print(Observables([m, a]).to_xml())
示例5: test_get_namespaces
# 需要导入模块: from cybox.objects.email_message_object import EmailMessage [as 别名]
# 或者: from cybox.objects.email_message_object.EmailMessage import subject [as 别名]
def test_get_namespaces(self):
m = EmailMessage()
m.to = "[email protected]"
m.subject = "Here's a cool picture"
m.links = Links()
u = URI("http://example.com/cool.jpg", URI.TYPE_URL)
m.links.append(u.parent.id_)
o = Observables([u, m])
logger.info(o.to_xml())
actual_namespaces = o._get_namespaces()
logger.info("\n".join([str(x) for x in actual_namespaces]))
self.assertEqual(5, len(actual_namespaces))
示例6: main
# 需要导入模块: from cybox.objects.email_message_object import EmailMessage [as 别名]
# 或者: from cybox.objects.email_message_object.EmailMessage import subject [as 别名]
def main():
print '<?xml version="1.0" encoding="UTF-8"?>'
attachment = File()
attachment.file_name = "FooBar Specification (critical revision).doc"
attachment.add_hash(Hash("4EC0027BEF4D7E1786A04D021FA8A67F"))
email = EmailMessage()
email.attachments.append(attachment)
email.subject = String("New modifications to the specification")
email.to = EmailRecipients(EmailAddress("[email protected]"),
EmailAddress("[email protected]"))
email.from_ = EmailAddress("[email protected]")
print Observables(email).to_xml()
示例7: main
# 需要导入模块: from cybox.objects.email_message_object import EmailMessage [as 别名]
# 或者: from cybox.objects.email_message_object.EmailMessage import subject [as 别名]
def main():
NS = cybox.utils.Namespace("http://example.com/", "example")
cybox.utils.set_id_namespace(NS)
# �I�u�W�F�N�g�̍쐬�iEmailMesage)
m = EmailMessage()
# �I�u�W�F�N�g�Ɋ֘A�t��
m.to = ["[email protected]", "[email protected]"]
m.from_ = "[email protected]"
m.subject = "New modifications to the specification"
# �I�u�W�F�N�g�̍쐬�iAdress)
a = Address("192.168.1.1", Address.CAT_IPV4)
# �I�u�W�F�N�g�Ԃ̊֘A
m.add_related(a, "Received_From", inline=False)
a.add_related(m, "Received_to", inline=False)
print Observables([m, a]).to_xml()