Skip to main content

Data package for Changelists CLI Tools

Project description

Changelist Data

Data Management for Changelists CLI Tools.

Usage Scenarios

This package is designed for the purpose of serving other changelist packages, and reducing code duplication.

Storage Scenarios

There are two storage options for Changelists.

  • The first is the .idea/workspace.xml file associated with popular IDEs.
  • The second is a dedicated .changelists/data.xml file managed by changelist-data on behalf of other changelist tools.

Each changelist tool must be compatible with both storage options. The goal of this package is to provide access to both storage options, and support the file reading and writing needs of all changelist tools.

Changelist Tools

The Data Storage needs of the Changelist Tools:

  • Changelist Init
    • Find & Update Existing Storage File
    • Create New Changelists File
  • ChangeList Sort
    • Find, Load & Update Existing Storage File
  • ChangeList FOCI
    • Find & Read Existing Storage File

Package Structure

Call the public methods of the appropriate package for the level of detail required.

  • changelist_data/ contains shared data classes.
  • changelist_data/storage/ contains storage methods for read and write access.
  • changelist_data/xml/ contains some xml tree abstractions and modules.
  • changelist_data/xml/changelists/ changelists data xml management.
  • changelist_data/xml/workspace/ workspace xml management.

Changelist Data

The highest level package does not import anything during initialization, or provide package level methods. It contains the common data classes shared by Changelist packages.

Common Data Classes:

class FileChange : Individual Files

  • before_path: str | None = None
  • before_dir: bool | None = None
  • after_path: str | None = None
  • after_dir: bool | None = None
Constructor Methods
  • create_fc: represents created file.
  • update_fc: a modified or moved file.
  • delete_fc: a deleted file.

class Changelist : Lists of Files

  • id: str
  • name: str
  • changes: list[FileChange] = field(default_factory=lambda: [])
  • comment: str = ""
  • is_default: bool = False
Module Methods
  • get_default_cl: Get the default or first changelist in a list, tuple, or Iterable.
  • compute_key: Compute a changelist key, derived from the changelist name.

Storage Package

This package contains modules for both workspace and changelist storage options. The storage option is passed in as an enum. Sensible default values are included.

  • read_storage(StorageType, Path) -> list[Changelist]
  • load_storage(StorageType, Path) -> ChangelistsDataStorage

Storage File Management:

  • Find Existing Storage File and Read or Load it (Default is Changelists data xml)
  • Search for Storage File via Argument (workspace file argument backwards compatibility)
  • Create Changelists Data File if not exists

Read-Only Changelist Requirements:

  • Find and Read the Workspace File into a List of Changelist data objects
  • Find and Read the Changelists Data File into a List of Changelist data objects

Loading Changelist Data Tree Structures:

  • Existing File is Loaded into one of the two Tree classes
  • Tree classes handle updates to the storage data file

File Validation Module

This module determines if a storage option is already in use (one of those files exists).

  • Check if .idea/workspace.xml exists
  • Check if .changelists/data.xml exists
  • Check given workspace_xml or data_xml file argument exists
  • Validate the Input File, prevent loading any file over 32MB

XML Changelists Package

This package provides all the methods one may need for processing Changelists XML.

  • read_xml(changelists_xml: str) -> list[Changelist]
  • load_tree(changelists_xml: str) -> ChangelistsTree
  • new_tree() -> ChangelistsTree

The new_tree method is a shortcut for creating a Changelists XML Tree. This is to be used when initializing changelist workflows for the first time in a project.

XML Workspace Package

This package provides methods for processing Workspace XML.

  • read_xml(workspace_xml: str) -> list[Changelist]
  • load_tree(workspace_xml: str) -> WorkspaceTree

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

changelist_data-0.3.2.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

changelist_data-0.3.2-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file changelist_data-0.3.2.tar.gz.

File metadata

  • Download URL: changelist_data-0.3.2.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for changelist_data-0.3.2.tar.gz
Algorithm Hash digest
SHA256 568004f2b3a54b0618a896b17ada7979232223b49b55f901a5c56a6aad879754
MD5 416c24e4b3c9fc2c90a437f10dca370d
BLAKE2b-256 edc96bd15480830b6c70b4d49d2ed5dc6fbc99112261c2a6f71075616bc8624d

See more details on using hashes here.

Provenance

The following attestation bundles were made for changelist_data-0.3.2.tar.gz:

Publisher: publish.yml on DK96-OS/changelist-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file changelist_data-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for changelist_data-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ce7f57e9b4f7352042b8d501f257352ffdad64154c789e5df1e56a1e7a8f2a7f
MD5 663235bb182cb7a016a767c2c59d66e1
BLAKE2b-256 147e524d4c3cf3f4653ccc3118fb88f6729b12d9f65fdf1ae4af21a2cab923a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for changelist_data-0.3.2-py3-none-any.whl:

Publisher: publish.yml on DK96-OS/changelist-data

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page