本文整理匯總了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()