Skip to content

Instantly share code, notes, and snippets.

@chmouel
Created October 16, 2013 18:15
Show Gist options
  • Save chmouel/7012301 to your computer and use it in GitHub Desktop.
Save chmouel/7012301 to your computer and use it in GitHub Desktop.

Python SwiftClient Rewrite

Introduction

While talking with Leah and Darryl it was becoming apparent that the current swiftclient had some limitations impossible to fix/workaround and a complete new approach to swiftclient to cleanup the old interfaces was needed.

A lot of the spaghetti code we have right now is historical due of how swiftclient born out from a single file in swift/client.py and copy pasted in bin/swift with CLI logic.

Packages/Namespaces

We agreed that having two different namespace in the same repository would be something we want. The new name has not been decided yet.

Code Organisation

Splitting the client.py to different files folder is something we are considering.

TODO: darryl to provide his view of the code reorg.

Plugins

A lot of the features we are implementing can be done as plugin using entry points which could provide the CLI implementation and the calls to the API needed as well as the test.

Something that could be modular enough for added as extra packages (i.e: to add CDN features).

We don’t want to have plugins done as an afterthought.

TODO: chmouel to provide his view of the code plugins.

CLI

Something that we really want to do is not having any logic inside the CLI and basically having just an argparse parser.

Help

If help is too long (i.e: –os-*) those will be concatenated

Tests

Testing CLI positional arguments would be a nice thing to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment