2 Commits

Author SHA1 Message Date
semantic-release
ab9f996174 0.5.4
All checks were successful
continuous-integration/drone/push Build is passing
Automatically generated by python-semantic-release
2022-07-05 08:26:41 +00:00
de78753675 fix: pass headers through KeyedWriterFactory
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-05 11:25:02 +03:00
4 changed files with 11 additions and 5 deletions

View File

@@ -2,6 +2,10 @@
<!--next-version-placeholder-->
## v0.5.4 (2022-07-05)
### Fix
* Pass headers through KeyedWriterFactory ([`de78753`](https://git.grassecon.net/cicnet/cic-cli/commit/de78753675242dd253359a5a5601d9062d81f0ee))
## v0.5.3 (2022-07-05)
### Fix
* Add auth headers to HTTPWriter ([`4eda0fb`](https://git.grassecon.net/cicnet/cic-cli/commit/4eda0fb5cc2c41a735619dc3e34f21c4e27fd112))

View File

@@ -1 +1 @@
__version__ = "0.5.3"
__version__ = "0.5.4"

View File

@@ -52,7 +52,7 @@ class HTTPWriter(OutputWriter):
path = self.path
if k is not None:
path = os.path.join(path, k)
logg.debug(f"http writer post {path} \n key: {k}, value: {v}")
logg.debug(f"HTTPWriter POST {path} data: {v}, headers: {self.headers}")
rq = urllib.request.Request(path, method="POST", data=v, headers=self.headers)
r = urllib.request.urlopen(rq)
logg.info(f"http writer submitted at {r.read()}")
@@ -85,13 +85,15 @@ class KeyedWriterFactory:
logg.debug(f"adding key {k} t keyed writer factory")
self.x[k] = v
def new(self, path=None, *_args, **_kwargs):
def new(self, path=None, headers: Dict[str, str] = None, *_args, **_kwargs):
writer_keyed = None
writer_immutable = None
if self.key_writer_constructor is not None:
writer_keyed = self.key_writer_constructor(path, **self.x)
if self.immutable_writer_constructor is not None:
writer_immutable = self.immutable_writer_constructor(path, **self.x)
writer_immutable = self.immutable_writer_constructor(
path, headers, **self.x
)
return KeyedWriter(writer_keyed, writer_immutable)

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "cic-cli"
version = "0.5.3"
version = "0.5.4"
description = "Generic cli tooling for the CIC token network"
authors = [
"Louis Holbrook <dev@holbrook.no>",