Skip to main content

Data Management base 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
    • Create New Changelists File
    • Find Existing Storage File
    • Update Existing Storage File (with git status info)
  • ChangeList Sort
    • Find Existing Storage File
    • Load Existing Storage File
    • Update Existing Storage File
  • ChangeList FOCI
    • Find Existing Storage File
    • Read Existing Storage File

Data Structures

class FileChange : Individual Files

  • before_path: str | None = None
  • before_dir: bool | None = None
  • after_path: str | None = None
  • after_dir: bool | None = None

class Changelist : Lists of Files

  • id: str
  • name: str
  • changes: list[FileChange] = field(default_factory=lambda: [])
  • comment: str = ""
  • is_default: bool = False

Package Structure

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

  • changelist_data/ contains high level methods with default options for accessing storage files
  • changelist_data/storage/ contains storage option specific methods for read-only and writable access.
  • changelist_data/xml/ contains some simple xml modules, and two subpackages.
  • changelist_data/xml/changelists/ changelists data xml management.
  • changelist_data/xml/workspace/ workspace xml management.

Changelist Data Storage Access Methods

The highest level package should contain the highest level methods and modules.

High Level Default Methods

  • read_default() -> list[Changelist]
  • load_default() -> ChangelistDataStorage
  • write_tree(ChangelistDataStorage, Path) -> bool

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

Storage Package

This package contains modules for both workspace and changelist storage options. Each option provides a reader and a tree loader.

  • read_changelists_storage(Path) -> list[Changelist]
  • read_workspace_storage(Path) -> list[Changelist]
  • load_changelists_tree(Path) -> ChangelistsTree
  • load_workspace_tree(Path) -> WorkspaceTree

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 Reader

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.1.1.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

changelist_data-0.1.1-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: changelist_data-0.1.1.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for changelist_data-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9d41cb7d81d5d4dfc71025c6f78ad4f6157bc36f70520d1d46a4adb766efe723
MD5 1c074c1b875df2f4de6b5fd108098b0d
BLAKE2b-256 9fc25342095d49b88d998c3d69fe9eb44af71b3b3221eb9b7cd4531e296a54e9

See more details on using hashes here.

Provenance

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

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

Attestations:

File details

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

File metadata

File hashes

Hashes for changelist_data-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a1ceb6083d576f5367737ad612c20339a92b3dc5cae4c046445f808b223cb92
MD5 30c912a41c49eafbc59a46cacec167b9
BLAKE2b-256 2cf21d2df2c13a7d9724c6a9056e756d3e610c40e57a5c698f7393604ac70a6b

See more details on using hashes here.

Provenance

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

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

Attestations:

Supported by

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