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.

EnumerationsEnumerationsEnumerationsEnumerations
shape`intNone`None
label`strNone`None
text_color`intNone`None
highlight_color`intNone`None
created`intNone`None
completed`intNone`None

Node’dan miras alındı

EnumerationsEnumerationsEnumerations
ParentNode`NodeNone`
Document`DocumentNone`

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() -> NoteTag

Yeni 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

 Türkçe