NoteTag — Aspose.Note FOSS for Python API Reference
Sınıf: NoteTag
Enumerations: aspose.note Enumerations: from aspose.note import NoteTag Enumerations: Node
NoteTag bir içerik düğümüne eklenmiş OneNote etiket simgesini (yıldız, onay kutusu, önemli işaretleyici vb.) temsil eder. Etiketler şunlarda görünür RichText, Image, AttachedFile, OutlineElement, ve Table düğümler aracılığıyla .Tags özelliği.
Enumerations
Tüm özellikler yalnızca okunabilir olup, MS-ONE ikili formatından doğrudan ayrıştırılan değerleri yansıtır.
| Enumerations | Enumerations | Enumerations | Enumerations |
|---|---|---|---|
shape | `int | None` | None |
label | `str | None` | None |
text_color | `int | None` | None |
highlight_color | `int | None` | None |
created | `int | None` | None |
completed | `int | None` | None |
Node’dan miras alındı
| Enumerations | Enumerations | Enumerations |
|---|---|---|
ParentNode | `Node | None` |
Document | `Document | None` |
Zaman Damgası Notu
created ve completed MS-ONE ikili formatından ayrıştırılan ham tamsayı zaman damgalarıdır. Bunlar değildir datetime nesnedir. Eğer bunlarla Python tarih-saatleri olarak çalışmanız gerekiyorsa, dönüşüm formülü için MS-ONE dosya formatı spesifikasyonuna bakın.
Fabrika Yöntemleri
NoteTag.CreateYellowStar()
tag = NoteTag.CreateYellowStar() -> NoteTagYeni bir NoteTag ile shape=None ve label="Yellow Star". Programlı olarak belgeler oluştururken kullanışlıdır.
Kullanım Örneği
Bir belgede etiketlenmiş tüm öğeleri listele
from aspose.note import Document, RichText, Image, AttachedFile, OutlineElement
doc = Document("MyNotes.one")
# Tags on RichText
for rt in doc.GetChildNodes(RichText):
for tag in rt.Tags:
print(f"RichText tag: label={tag.label!r} on: {rt.Text.strip()[:40]!r}")
# Tags on Images
for img in doc.GetChildNodes(Image):
for tag in img.Tags:
print(f"Image tag: label={tag.label!r} file={img.FileName!r}")
# Tags on AttachedFiles
for af in doc.GetChildNodes(AttachedFile):
for tag in af.Tags:
print(f"Attachment tag: label={tag.label!r} file={af.FileName!r}")Tamamlanmamış “To Do” etiketlerini filtrele
from aspose.note import Document, RichText
doc = Document("MyNotes.one")
for rt in doc.GetChildNodes(RichText):
for tag in rt.Tags:
if tag.label and "to do" in tag.label.lower() and tag.completed is None:
print(f"Incomplete TODO: {rt.Text.strip()!r}")None-Güvenliği
label, shape, text_color, highlight_color, created, ve completed hepsi olabilir None. Kullanımdan önce koruyun. Tags içerik düğümlerindeki listeler her zaman listedir (asla None), ancak boş olabilir.
Ayrıca Bakınız
- Enumerations: temel sınıf
- RichText: etiket taşıyan metin düğümleri
- AttachedFile: etiket taşıyan ek düğümleri
- Enumerations: etiket taşıyan görüntü düğümleri
- Geliştirici Kılavuzu