Skip to content

Commit

Permalink
refactor: replace resource instance factory (DEV-2876) (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
BalduinLandolt committed Nov 7, 2023
1 parent 40000a8 commit 906a211
Show file tree
Hide file tree
Showing 26 changed files with 952 additions and 1,038 deletions.
2 changes: 1 addition & 1 deletion docs/file-formats/xml-data-file.md
Expand Up @@ -280,7 +280,7 @@ Attributes:

#### `<boolean>`

The `<boolean>` element must contain the string "true" or "false", or the numeral 1 (true) or 0 (false).
The `<boolean>` element must contain the string "true"/"True" or "false"/"False", or the numeral 1 (true) or 0 (false).

Attributes:

Expand Down
4 changes: 2 additions & 2 deletions src/dsp_tools/cli.py
Expand Up @@ -28,7 +28,7 @@
from dsp_tools.utils.rosetta import upload_rosetta
from dsp_tools.utils.shared import validate_xml_against_schema
from dsp_tools.utils.stack_handling import StackConfiguration, StackHandler
from dsp_tools.utils.xmlupload.upload_config import UploadConfig
from dsp_tools.utils.xmlupload.upload_config import DiagnosticsConfig, UploadConfig
from dsp_tools.utils.xmlupload.xmlupload import xmlupload

logger = get_logger(__name__)
Expand Down Expand Up @@ -485,7 +485,7 @@ def _call_requested_action(args: argparse.Namespace) -> bool:
password=args.password,
imgdir=args.imgdir,
sipi=args.sipi_url,
config=UploadConfig(verbose=args.verbose, dump=args.dump),
config=UploadConfig(diagnostics=DiagnosticsConfig(verbose=args.verbose, dump=args.dump)),
)
elif args.action == "process-files":
success = process_files(
Expand Down
8 changes: 6 additions & 2 deletions src/dsp_tools/connection/connection_live.py
Expand Up @@ -175,7 +175,9 @@ def post(
response = requests.post(
url=url,
headers=headers,
data=jsondata,
# if data is not encoded as bytes, issues can occur with non-ASCII characters,
# where the content-length of the request will turn out to be different from the actual length
data=jsondata.encode("utf-8") if jsondata else None,
timeout=timeout,
)
if self.dump:
Expand Down Expand Up @@ -265,7 +267,9 @@ def put(
response = requests.put(
url=url,
headers=headers,
data=jsondata,
# if data is not encoded as bytes, issues can occur with non-ASCII characters,
# where the content-length of the request will turn out to be different from the actual length
data=jsondata.encode("utf-8") if jsondata else None,
timeout=timeout,
)
if self.dump:
Expand Down

0 comments on commit 906a211

Please sign in to comment.