Skip to content

Refactor: Extract shared module from pwrap.py and cwrap.py to remove code duplication #364

@GaneshPatil7517

Description

@GaneshPatil7517

demo/pwrap.py (129 lines) and demo/cwrap.py (124 lines) share ~95% identical code:

  • Same API key loading logic (lines 12-20)
  • Same yuyu loading logic
  • Same name1/name2 loading logic
  • Same init value loading logic
  • Same polling/retry loop structure
  • Same bare except: error handling

The only difference is the HTTP endpoint URL (/pm/ vs /ctl/) and which variable is input vs output. These should be refactored into a single shared module with the endpoint as a parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions