Skip to content

Commit

Permalink
fix files reported by black
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelD committed Nov 29, 2024
1 parent d07b392 commit cf37e11
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 13 additions & 3 deletions .github/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import os


def find_manifest_file():
"""
Search for manifest.json in the project directory.
Expand All @@ -11,6 +12,7 @@ def find_manifest_file():
return os.path.join(root, "manifest.json")
raise FileNotFoundError("manifest.json file not found in the project directory.")


def update_manifest_version(version):
"""
Update the version in the manifest.json file.
Expand All @@ -29,21 +31,29 @@ def update_manifest_version(version):
# Write the updated manifest back to the file
with open(manifest_path, "w") as file:
json.dump(manifest_data, file, indent=4)

print(f"Successfully updated version to {version} in manifest.json.")
except FileNotFoundError as e:
print(e)
except Exception as e:
print(f"An error occurred: {e}")


def main():
# Set up argument parsing
parser = argparse.ArgumentParser(description="Update the version in the manifest.json file.")
parser.add_argument("--version", required=True, help="The new version to set in the manifest.json file.")
parser = argparse.ArgumentParser(
description="Update the version in the manifest.json file."
)
parser.add_argument(
"--version",
required=True,
help="The new version to set in the manifest.json file.",
)
args = parser.parse_args()

# Update the manifest version
update_manifest_version(args.version)


if __name__ == "__main__":
main()
6 changes: 3 additions & 3 deletions custom_components/portainer/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def extra_state_attributes(self) -> Mapping[str, Any]:
attributes[format_attribute(variable)] = self._data[variable]
else:
for custom_variable in self._data[variable]:
attributes[format_attribute(custom_variable)] = self._data[variable][
custom_variable
]
attributes[format_attribute(custom_variable)] = self._data[
variable
][custom_variable]

return attributes

Expand Down

0 comments on commit cf37e11

Please sign in to comment.