Skip to content

Commit

Permalink
fix: preserve metadata key case
Browse files Browse the repository at this point in the history
  • Loading branch information
komima authored and nlssakokorhonen committed Nov 9, 2022
1 parent e81767e commit e1c91f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Feat: Add publish command to cli
- Fix: Support build without actually importing the code
- Fix: Preserve case for key names in metadata file

## [0.4.0] - 2022-11-01

Expand Down
7 changes: 6 additions & 1 deletion src/qgis_plugin_dev_tools/build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@
from pathlib import Path


class PreserveKeyCaseConfigParser(ConfigParser):
def optionxform(self, optionstr: str) -> str:
return optionstr


def update_metadata_file(
metadata_file_path: Path, version: str, changelog_contents: str
) -> None:
parser = ConfigParser()
parser = PreserveKeyCaseConfigParser()
parser.read(metadata_file_path, encoding="utf-8")
parser.set("general", "version", version)
parser.set("general", "changelog", changelog_contents)
Expand Down
1 change: 1 addition & 0 deletions whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ metavar
util
pyd
base64
optionstr

0 comments on commit e1c91f7

Please sign in to comment.