flexicon.code.Lists package

Submodules

flexicon.code.Lists.AgentOperations module

class flexicon.code.Lists.AgentOperations.AgentOperations(project)[source]

Bases: PossibilityItemOperations

Agent operations for managing human analysts and automated parsers.

Agents represent either human analysts or automated parsers that perform linguistic analysis. They track who (or what) created analyses, glosses, and evaluations in the project.

Overridden CRUD Operations (AnalyzingAgentsOC has no PossibilitiesOS): - GetAll() - Get all agents (iterates OC directly) - Create() - Create new agent (uses ICmAgentFactory + OC.Add) - Delete() - Delete agent (uses OC.Remove) - Duplicate() - Clone agent (uses OC.Add) - Find() - Find by name (searches OC directly)

Inherited Operations (from PossibilityItemOperations): - Exists() - Check existence - GetName() / SetName() - Get/set name - GetDescription() / SetDescription() - Get/set description - GetGuid() - Get GUID - CompareTo() - Compare by name

Domain-Specific Methods (AgentOperations): - CreateHumanAgent() - Create human agent linked to person - CreateParserAgent() - Create parser agent with version - GetVersion() / SetVersion() - Get/set parser version - IsHuman() / IsParser() - Check agent type - GetHuman() / SetHuman() - Link to ICmPerson - GetEvaluations() / GetEvaluationCount() - Get evaluations - FindByType() - Find by agent type - GetHumanAgents() / GetParserAgents() - Get all of type - GetDateCreated() / GetDateModified() - Get timestamps

GetAll()[source]

Iterate over all agents in the project’s AnalyzingAgentsOC.

Overrides the PossibilityItemOperations.GetAll inherited default, which assumes the list-object has PossibilitiesOS. LangProject.AnalyzingAgentsOC is a plain LcmOwningCollection of ICmAgent, not a CmPossibilityList, so PossibilitiesOS doesn’t exist on it – AttributeError every call. Iterate the collection directly.

Returns:

List of ICmAgent objects.

Return type:

list

Notes

  • Returns ALL agents, including stale parser-version agents left behind when the parser is upgraded. Callers that want only human analysts should filter with:

    [a for a in project.Agents.GetAll()
     if project.Agents.IsHuman(a)]
    

    or call GetHumanAgents() directly.

Create(*args, **kwargs)

Automatically instantiate and call the method.

Delete(*args, **kwargs)

Automatically instantiate and call the method.

Duplicate(*args, **kwargs)

Automatically instantiate and call the method.

Find(*args, **kwargs)

Automatically instantiate and call the method.

GetVersion(*args, **kwargs)

Automatically instantiate and call the method.

SetVersion(*args, **kwargs)

Automatically instantiate and call the method.

IsHuman(*args, **kwargs)

Automatically instantiate and call the method.

IsParser(*args, **kwargs)

Automatically instantiate and call the method.

GetHuman(*args, **kwargs)

Automatically instantiate and call the method.

SetHuman(*args, **kwargs)

Automatically instantiate and call the method.

GetEvaluations(*args, **kwargs)

Automatically instantiate and call the method.

GetEvaluationCount(*args, **kwargs)

Automatically instantiate and call the method.

FindByType(*args, **kwargs)

Automatically instantiate and call the method.

GetHumanAgents(*args, **kwargs)

Automatically instantiate and call the method.

GetParserAgents(*args, **kwargs)

Automatically instantiate and call the method.

GetDateCreated(*args, **kwargs)

Automatically instantiate and call the method.

GetDateModified(*args, **kwargs)

Automatically instantiate and call the method.

flexicon.code.Lists.ConfidenceOperations module

class flexicon.code.Lists.ConfidenceOperations.ConfidenceOperations(project)[source]

Bases: PossibilityItemOperations

This class provides operations for managing confidence levels (quality ratings) in a FieldWorks project.

Confidence levels are used to rate the quality or certainty of linguistic analyses and glosses. They provide a standardized way to indicate how confident a linguist or parser is about a particular analysis or gloss. Confidence levels are implemented as a possibility list using ICmPossibility.

Common confidence levels might include: - High Confidence (for well-established analyses) - Medium Confidence (for probable but uncertain analyses) - Low Confidence (for tentative analyses) - Unconfirmed (for machine-generated or unverified analyses)

Inherited CRUD Operations (from PossibilityItemOperations): - GetAll() - Get all confidence levels - Create() - Create a new confidence level - Delete() - Delete a confidence level - Duplicate() - Clone a confidence level - Find() - Find by name - Exists() - Check existence - GetName() / SetName() - Get/set name - GetDescription() / SetDescription() - Get/set description - GetGuid() - Get GUID - CompareTo() - Compare by name

Domain-Specific Methods (ConfidenceOperations): - GetAnalysesWithConfidence() - Find analyses using a level - GetGlossesWithConfidence() - Find glosses using a level - GetDefault() - Get default confidence level

This class should be accessed via FLExProject.Confidence property.

Usage:

from flexlibs2 import FLExProject

project = FLExProject()
project.OpenProject("my project", writeEnabled=True)

# Get all confidence levels
for level in project.Confidence.GetAll():
    name = project.Confidence.GetName(level)
    desc = project.Confidence.GetDescription(level)
    print(f"{name}: {desc}")

# Find a specific confidence level
high = project.Confidence.Find("High Confidence")
if high:
    # Get analyses using this confidence level
    analyses = project.Confidence.GetAnalysesWithConfidence(high)
    print(f"{len(analyses)} analyses have high confidence")

# Create a custom confidence level
custom = project.Confidence.Create("Verified", "en")
project.Confidence.SetDescription(custom,
    "Analysis verified by native speaker")

# Find the default confidence level
default = project.Confidence.GetDefault()
if default:
    print(f"Default: {project.Confidence.GetName(default)}")

project.CloseProject()
GetAnalysesWithConfidence(*args, **kwargs)

Automatically instantiate and call the method.

GetGlossesWithConfidence(*args, **kwargs)

Automatically instantiate and call the method.

GetDefault(*args, **kwargs)

Automatically instantiate and call the method.

flexicon.code.Lists.LocalizedListsOperations module

class flexicon.code.Lists.LocalizedListsOperations.SkippedWS(code, reason)

Bases: tuple

One entry in ImportLocalizedListsResult.skipped.

Fields:
code (str): IcuLocale of the writing system that was skipped, or

"<empty>" if the WS had no IcuLocale set.

reason (str): Short diagnostic explaining why the pack was not

applied. One of the SKIP_* module constants, or a more specific message for the file-not-found path.

code

Alias for field number 0

reason

Alias for field number 1

class flexicon.code.Lists.LocalizedListsOperations.ImportLocalizedListsResult(imported, skipped)

Bases: tuple

Structured result for ImportForAllAnalysisWritingSystems.

Fields:
imported (list[str]): IcuLocale codes whose translation pack was

successfully merged into the project’s possibility lists.

skipped (list[SkippedWS]): One SkippedWS(code, reason) entry

per writing system whose pack was not applied. code is the IcuLocale (or "<empty>" if the WS had no IcuLocale set); reason is a short human-readable diagnostic, generally one of the SKIP_* module constants.

imported

Alias for field number 0

skipped

Alias for field number 1

class flexicon.code.Lists.LocalizedListsOperations.LocalizedListsOperations(project)[source]

Bases: BaseOperations

Localized possibility-list translation-pack imports.

Translation packs ship at <FWCodeDir>/Templates/LocalizedLists-<lang>.zip and carry Name and Abbreviation alternatives for the canonical possibility lists shared across LangProject and LexDb (SemanticDomains, AnthroList, DomainTypes, UsageTypes, RestrictionsList, …). Items are matched by canonical GUID, so the corresponding ImportCatalog call must have already seeded those items in English before translations can land.

Access via FLExProject.LocalizedLists – a lazy property.

Usage:

from flexlibs2 import FLExProject

project = FLExProject()
project.OpenProject("MyProject", writeEnabled=True)

# Seed canonical SemDom items in English first.
project.SemanticDomains.ImportCatalog()

# Layer translations for one specific WS.
project.LocalizedLists.Import("fr")

# Or fan out across every enabled analysis WS that has a
# shipping pack:
result = project.LocalizedLists.ImportForAllAnalysisWritingSystems()
print(result.imported)  # e.g. ["en", "fr"]
for code, reason in result.skipped:
    print(f"  skipped {code}: {reason}")
Import(language_code, progress=None)[source]

Import the localized-lists ZIP for a target writing system.

Wraps XmlTranslatedLists.ImportTranslatedListsForWs – LCM’s purpose-built importer for translated lists. Unlike XmlList.ImportList (which appends new items), this method merges Name / Abbreviation alternatives onto existing items by canonical GUID; no duplicates are created.

Order matters: call after *Operations.ImportCatalog has seeded canonical items, never before. Translation packs match by canonical GUID and silently ignore GUIDs they don’t carry, so calling Import before the catalog leaves nothing to merge onto.

Parameters:
  • language_code (str) – ISO writing-system code identifying which LocalizedLists-XX.zip to import. Examples: "fr", "es", "ar", "zh-CN".

  • progress – Optional SIL.LCModel.Utils.IProgress instance for progress reporting. None (default) skips reporting.

Raises:

Example

>>> project.OpenProject("MyProject", writeEnabled=True)
>>> project.SemanticDomains.ImportCatalog()
>>> project.LocalizedLists.Import("fr")
>>> project.LocalizedLists.Import("es")

Notes

Translation packs match by canonical GUID and silently ignore GUIDs they don’t recognise (and silently leave GUIDs they don’t carry untranslated). Catalog skew is therefore invisible at the call site. The biggest known case: OCM-Frame.xml (loaded via AnthropologyOperations.ImportFrameCatalog) carries 116 GUIDs that OCM.xml does not. Pairing the wrong catalog with the wrong pack leaves part of AnthroListOA untranslated without any warning. (issue #82)

ImportForAllAnalysisWritingSystems(progress=None)[source]

Import LocalizedLists translation packs for every enabled analysis writing system whose IcuLocale matches a shipping LocalizedLists-<IcuLocale>.zip.

Iterates project.ServiceLocator.WritingSystems .CurrentAnalysisWritingSystems and dispatches Import(ws.IcuLocale) for each entry. WSes whose IcuLocale does not map to a shipping ZIP are reported in the skipped field of the returned result rather than silently ignored.

Convenience wrapper over Import that closes the typical post-ImportCatalog gap: a user enables an analysis WS (Portuguese, French, …), runs SemanticDomains .ImportCatalog and then expects the catalog items to carry translations for every WS they’ve enabled.

Important: this does NOT back-fill translations for analysis WSes that get enabled AFTER catalog content is added. Re-run this method (or call Import(code) directly) after enabling additional analysis WSes.

Precondition: at least one ImportCatalog call should have run first – the merger has nothing to land on otherwise. A logger.warning is emitted if SemanticDomainsOA is empty when this method is invoked.

Parameters:

progress – Optional SIL.LCModel.Utils.IProgress instance passed through to each Import call.

Returns:

Named tuple with imported (list[str] of IcuLocale codes that merged successfully) and skipped (list[SkippedWS] of SkippedWS(code, reason) entries for WSes that did not apply).

Return type:

ImportLocalizedListsResult

Raises:

FP_ReadOnlyError – If the project is not write-enabled.

Warns:

UserWarning – If the SemanticDomains list is empty when this method is invoked – translation packs will silently no-op because there are no canonical items to merge onto. Raised via warnings.warn so it surfaces in interactive REPL use.

Example

>>> project.OpenProject("MyProject", writeEnabled=True)
>>> project.SemanticDomains.ImportCatalog()
>>> result = project.LocalizedLists.ImportForAllAnalysisWritingSystems()
>>> # result.imported == ["en", "fr"] if those packs ship
>>> # result.skipped == [SkippedWS("pt", "no shipping translation pack")]

flexicon.code.Lists.OverlayOperations module

class flexicon.code.Lists.OverlayOperations.OverlayOperations(project)[source]

Bases: PossibilityItemOperations

Discourse chart overlay and layer management operations for FLEx projects.

This class provides methods for creating and managing overlays (layers) in discourse constituent charts. Overlays allow multiple levels of analysis to be displayed in the same chart, with each overlay representing a different analytical perspective or feature set.

Overlays can be toggled on/off for visibility and have customizable display order. They are used to organize complex chart analyses by separating different aspects of discourse structure into manageable layers.

Inherited CRUD Operations (from PossibilityItemOperations): - GetAll() - Get all overlays (NOTE: requires chart context, see special handling) - Create() - Create a new overlay - Delete() - Delete an overlay - Duplicate() - Clone an overlay - Find() - Find by name - Exists() - Check existence - GetName() / SetName() - Get/set name - GetDescription() / SetDescription() - Get/set description - GetGuid() - Get GUID - CompareTo() - Compare by name

Domain-Specific Methods (OverlayOperations): - IsVisible() - Check visibility - SetVisible() - Set visibility - GetDisplayOrder() - Get display order - SetDisplayOrder() - Set display order - GetElements() - Get overlay elements - AddElement() - Add element to overlay - RemoveElement() - Remove element from overlay - GetChart() - Get parent chart - GetPossItems() - Get possibility items - FindByChart() - Find overlays for a chart - GetVisibleOverlays() - Get visible overlays for a chart

Note

Overlays are specific to constituent charts (IConstChart). They provide a way to layer multiple analytical perspectives in a single chart view. GetAll() requires chart context - use FindByChart() instead for chart-specific queries.

Usage:

from flexlibs2 import FLExProject, DiscourseOperations, OverlayOperations

project = FLExProject()
project.OpenProject("my project", writeEnabled=True)

discourse_ops = DiscourseOperations(project)
overlay_ops = OverlayOperations(project)

# Get a chart
text = list(project.Texts.GetAll())[0]
charts = list(discourse_ops.GetAllCharts(text))
chart = charts[0]

# Get overlays for the chart
overlays = list(overlay_ops.FindByChart(chart))
print(f"Chart has {len(overlays)} overlays")

# Create a new overlay
overlay = overlay_ops.Create("Participants")
overlay_ops.SetDescription(overlay, "Track participant chains")

# Configure visibility and display order
overlay_ops.SetVisible(overlay, True)
overlay_ops.SetDisplayOrder(overlay, 1)

# Get visible overlays
visible = list(overlay_ops.GetVisibleOverlays(chart))
print(f"Chart has {len(visible)} visible overlays")

project.CloseProject()
IsVisible(*args, **kwargs)

Automatically instantiate and call the method.

SetVisible(*args, **kwargs)

Automatically instantiate and call the method.

GetDisplayOrder(*args, **kwargs)

Automatically instantiate and call the method.

SetDisplayOrder(*args, **kwargs)

Automatically instantiate and call the method.

GetElements(*args, **kwargs)

Automatically instantiate and call the method.

AddElement(*args, **kwargs)

Automatically instantiate and call the method.

RemoveElement(*args, **kwargs)

Automatically instantiate and call the method.

GetChart(*args, **kwargs)

Automatically instantiate and call the method.

GetPossItems(*args, **kwargs)

Automatically instantiate and call the method.

FindByChart(*args, **kwargs)

Automatically instantiate and call the method.

GetVisibleOverlays(*args, **kwargs)

Automatically instantiate and call the method.

flexicon.code.Lists.PossibilityListOperations module

class flexicon.code.Lists.PossibilityListOperations.PossibilityListOperations(project)[source]

Bases: BaseOperations

This class provides generic operations for managing possibility lists in a FieldWorks project.

Possibility lists are hierarchical categorization systems used throughout FLEx for various purposes (e.g., semantic domains, parts of speech, grammatical categories, locations, people, text genres, etc.).

This class provides generic operations that work with any possibility list, regardless of its specific purpose.

This class should be accessed via FLExProject.PossibilityLists property.

Usage:

from flexlibs2 import FLExProject

project = FLExProject()
project.OpenProject("my project", writeEnabled=True)

# Get all possibility lists in the project
for poss_list in project.PossibilityLists.GetAllLists():
    name = project.PossibilityLists.GetListName(poss_list)
    print(f"List: {name}")

    # Get items in each list
    items = project.PossibilityLists.GetItems(poss_list)
    print(f"  Contains {len(items)} items")

# Work with a specific list
genre_list = project.PossibilityLists.FindList("Text Genres")
if genre_list:
    # Create a new genre
    narrative = project.PossibilityLists.CreateItem(
        genre_list, "Narrative", "en")

    # Create a sub-genre
    folktale = project.PossibilityLists.CreateItem(
        genre_list, "Folktale", "en", parent=narrative)

project.CloseProject()
GetAllLists(*args, **kwargs)

Automatically instantiate and call the method.

CreateList(*args, **kwargs)

Automatically instantiate and call the method.

DeleteList(*args, **kwargs)

Automatically instantiate and call the method.

FindList(*args, **kwargs)

Automatically instantiate and call the method.

GetListName(*args, **kwargs)

Automatically instantiate and call the method.

SetListName(*args, **kwargs)

Automatically instantiate and call the method.

GetItems(*args, **kwargs)

Automatically instantiate and call the method.

CreateItem(*args, **kwargs)

Automatically instantiate and call the method.

DeleteItem(*args, **kwargs)

Automatically instantiate and call the method.

Duplicate(*args, **kwargs)

Automatically instantiate and call the method.

GetSyncableProperties(*args, **kwargs)

Automatically instantiate and call the method.

CompareTo(*args, **kwargs)

Automatically instantiate and call the method.

FindItem(*args, **kwargs)

Automatically instantiate and call the method.

GetItemName(*args, **kwargs)

Automatically instantiate and call the method.

SetItemName(*args, **kwargs)

Automatically instantiate and call the method.

GetItemAbbreviation(*args, **kwargs)

Automatically instantiate and call the method.

SetItemAbbreviation(*args, **kwargs)

Automatically instantiate and call the method.

GetItemDescription(*args, **kwargs)

Automatically instantiate and call the method.

SetItemDescription(*args, **kwargs)

Automatically instantiate and call the method.

GetSubitems(*args, **kwargs)

Automatically instantiate and call the method.

GetParentItem(*args, **kwargs)

Automatically instantiate and call the method.

MoveItem(*args, **kwargs)

Automatically instantiate and call the method.

GetDepth(*args, **kwargs)

Automatically instantiate and call the method.

GetListGuid(*args, **kwargs)

Automatically instantiate and call the method.

GetItemGuid(*args, **kwargs)

Automatically instantiate and call the method.

GetItemHvo(*args, **kwargs)

Automatically instantiate and call the method.

GetListHvo(*args, **kwargs)

Automatically instantiate and call the method.

flexicon.code.Lists.PublicationOperations module

class flexicon.code.Lists.PublicationOperations.PublicationOperations(project)[source]

Bases: PossibilityItemOperations

This class provides operations for managing publications and publishing workflows in a FieldWorks project.

Publications in FLEx define output formats for dictionary and text publishing. They specify page layouts, formatting options, divisions (e.g., main entries, minor entries), header/footer settings, and default publication types. These are used when exporting dictionaries or texts to various formats.

Inherited CRUD Operations (from PossibilityItemOperations): - GetAll() - Get all publications (NOTE: override handles flat parameter) - Create() - Create a new publication - Delete() - Delete a publication - Duplicate() - Clone a publication - Find() - Find by name - Exists() - Check existence - GetName() / SetName() - Get/set name - GetDescription() / SetDescription() - Get/set description - GetGuid() - Get GUID - CompareTo() - Compare by name

Domain-Specific Methods (PublicationOperations): - GetPageLayout() - Get page layout description - SetPageLayout() - Set page layout description - GetIsDefault() - Check if default publication - SetIsDefault() - Set default publication - GetPageHeight() - Get page height - SetPageHeight() - Set page height - GetPageWidth() - Get page width - SetPageWidth() - Set page width - GetDivisions() - Get publication divisions - AddDivision() - Add a division - GetHeaderFooter() - Get header/footer configuration - GetIsLandscape() - Check landscape orientation - GetSubPublications() - Get sub-publications - GetParent() - Get parent publication - GetDateCreated() - Get creation date - GetDateModified() - Get modification date

This class should be accessed via FLExProject.Publications property.

Usage:

from flexlibs2 import FLExProject

project = FLExProject()
project.OpenProject("my project", writeEnabled=True)

# Get all publications
for pub in project.Publications.GetAll():
    name = project.Publications.GetName(pub)
    is_default = project.Publications.GetIsDefault(pub)
    print(f"{name} (Default: {is_default})")

# Create a new publication
pub = project.Publications.Create("Web Dictionary")

# Set page layout and formatting
project.Publications.SetPageWidth(pub, 8.5)
project.Publications.SetPageHeight(pub, 11.0)
project.Publications.SetDescription(pub,
    "Dictionary layout for web publication")

# Set as default publication
project.Publications.SetIsDefault(pub, True)

# Find a publication by name
main_pub = project.Publications.Find("Main Dictionary")
if main_pub:
    width = project.Publications.GetPageWidth(main_pub)
    height = project.Publications.GetPageHeight(main_pub)
    print(f"Page size: {width} x {height} inches")

project.CloseProject()
GetAll(**kwargs)
GetPageLayout(*args, **kwargs)

Automatically instantiate and call the method.

SetPageLayout(*args, **kwargs)

Automatically instantiate and call the method.

GetIsDefault(*args, **kwargs)

Automatically instantiate and call the method.

SetIsDefault(*args, **kwargs)

Automatically instantiate and call the method.

GetPageHeight(*args, **kwargs)

Automatically instantiate and call the method.

SetPageHeight(*args, **kwargs)

Automatically instantiate and call the method.

GetPageWidth(*args, **kwargs)

Automatically instantiate and call the method.

SetPageWidth(*args, **kwargs)

Automatically instantiate and call the method.

GetDivisions(*args, **kwargs)

Automatically instantiate and call the method.

AddDivision(*args, **kwargs)

Automatically instantiate and call the method.

GetHeaderFooter(*args, **kwargs)

Automatically instantiate and call the method.

GetIsLandscape(*args, **kwargs)

Automatically instantiate and call the method.

GetSubPublications(*args, **kwargs)

Automatically instantiate and call the method.

GetParent(*args, **kwargs)

Automatically instantiate and call the method.

GetDateCreated(*args, **kwargs)

Automatically instantiate and call the method.

GetDateModified(*args, **kwargs)

Automatically instantiate and call the method.

flexicon.code.Lists.TranslationTypeOperations module

class flexicon.code.Lists.TranslationTypeOperations.TranslationTypeOperations(project)[source]

Bases: PossibilityItemOperations

Translation type operations for managing translation categories.

Translation types categorize different kinds of translations such as free translation (idiomatic), literal translation (word-for-word), and back translation (reverse translation for verification).

Inherited CRUD Operations (from PossibilityItemOperations): - GetAll() - Get all translation types - Create() - Create new type - Delete() - Delete type - Duplicate() - Clone type - Find() - Find by name - Exists() - Check existence - GetName() / SetName() - Get/set name - GetDescription() / SetDescription() - Get/set description - GetGuid() - Get GUID - CompareTo() - Compare by name

Domain-Specific Methods (TranslationTypeOperations): - GetAbbreviation() / SetAbbreviation() - Get/set abbreviation - GetAnalysisWS() / SetAnalysisWS() - Get/set analysis writing systems - GetTextsWithType() - Find texts using type - GetSegmentsWithType() - Find segments using type - GetFreeTranslationType() - Get predefined free type - GetLiteralTranslationType() - Get predefined literal type - GetBackTranslationType() - Get predefined back type - FindByWS() - Find by writing system - IsDefault() / SetDefault() - Check/set default status

GetAbbreviation(*args, **kwargs)

Automatically instantiate and call the method.

SetAbbreviation(*args, **kwargs)

Automatically instantiate and call the method.

GetAnalysisWS(*args, **kwargs)

Automatically instantiate and call the method.

SetAnalysisWS(*args, **kwargs)

Automatically instantiate and call the method.

GetTextsWithType(*args, **kwargs)

Automatically instantiate and call the method.

GetSegmentsWithType(*args, **kwargs)

Automatically instantiate and call the method.

GetFreeTranslationType(*args, **kwargs)

Automatically instantiate and call the method.

GetLiteralTranslationType(*args, **kwargs)

Automatically instantiate and call the method.

GetBackTranslationType(*args, **kwargs)

Automatically instantiate and call the method.

FindByWS(*args, **kwargs)

Automatically instantiate and call the method.

IsDefault(*args, **kwargs)

Automatically instantiate and call the method.

SetDefault(*args, **kwargs)

Automatically instantiate and call the method.

flexicon.code.Lists.possibility_item_base module

class flexicon.code.Lists.possibility_item_base.PossibilityItemOperations(project)[source]

Bases: BaseOperations

Base class for operations on specialized possibility list items.

Provides unified CRUD operations for possibility-based items like Publications, Confidence Levels, Translation Types, Agents, and Overlays. Each subclass specializes the base class by:

  1. Accessing the appropriate list object (e.g., ConfidenceLevelsOA)

  2. Specifying the item class name (e.g., ‘Confidence’, ‘Publication’)

  3. Providing domain-specific methods (e.g., GetPageWidth, IsVisible)

Shared Operations (inherited by all subclasses): - GetAll() - Get all items (basic implementation, may be overridden) - Create() - Create new item with validation - Delete() - Delete item from list - Duplicate() - Clone item with new GUID - Find() - Find item by name - Exists() - Check if item exists by name - GetName() / SetName() - Get/set item name - GetDescription() / SetDescription() - Get/set item description - GetSyncableProperties() - Return dict of syncable properties - CompareTo() - Compare two items - GetGuid() - Get GUID

Subclasses must implement: - __init__() - Call super().__init__(project) - _GetSequence() - Return parent.SubPossibilitiesOS (for reordering) - _get_item_class_name() - Return item class name string - _get_list_object() - Return the list container object

Example subclass structure:

class ConfidenceOperations(PossibilityItemOperations):
    def _get_item_class_name(self):
        return "Confidence"

    def _get_list_object(self):
        return self.project.lp.ConfidenceLevelsOA

    # Domain-specific methods
    def GetAnalysesWithConfidence(self, level):
        ...
GetAll(**kwargs)
Create(*args, **kwargs)

Automatically instantiate and call the method.

Delete(*args, **kwargs)

Automatically instantiate and call the method.

Duplicate(*args, **kwargs)

Automatically instantiate and call the method.

Find(*args, **kwargs)

Automatically instantiate and call the method.

Exists(*args, **kwargs)

Automatically instantiate and call the method.

GetName(*args, **kwargs)

Automatically instantiate and call the method.

SetName(*args, **kwargs)

Automatically instantiate and call the method.

GetDescription(*args, **kwargs)

Automatically instantiate and call the method.

SetDescription(*args, **kwargs)

Automatically instantiate and call the method.

GetGuid(*args, **kwargs)

Automatically instantiate and call the method.

CompareTo(*args, **kwargs)

Automatically instantiate and call the method.

GetSyncableProperties(*args, **kwargs)

Automatically instantiate and call the method.

Module contents