Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix chargelog #1483

Merged
merged 3 commits into from Mar 25, 2024
Merged

fix chargelog #1483

merged 3 commits into from Mar 25, 2024

Conversation

LKuemmel
Copy link
Contributor

No description provided.

@LKuemmel LKuemmel added this to the 2.1.4 milestone Mar 15, 2024
@LKuemmel LKuemmel changed the title upgrade existing timestamp in chargelog data fix chargelog Mar 15, 2024
@LKuemmel LKuemmel requested a review from benderl March 15, 2024 13:25
@@ -1320,3 +1320,16 @@ def convert_file(file):
for file in files:
convert_file(file)
self.__update_topic("openWB/system/datastore_version", 38)

def upgrade_datastore_38(self) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sollte der Suffix nicht auch angepasst werden? Falls nicht, sollte man ihn dann nicht ganz abschaffen?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was meinst Du genau mit "Suffix"?

Comment on lines 118 to 123
def get_value_or_default(func):
try:
return func()
except Exception:
log.exception(f"Error getting value für chargelog: {func}. Setting to default.")
return "-"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_value_or_default(func):
try:
return func()
except Exception:
log.exception(f"Error getting value für chargelog: {func}. Setting to default.")
return "-"
def get_value_or_default(func, default_value = "-"):
try:
return func()
except Exception:
log.exception(f"Error getting value for chargelog: {func}. Setting to default.")
return default_value

Wenn man den Standardwert übergeben kann, wird die Methode wesentlich vielseitiger nutzbar.
In dem Zuge sollte überdacht werden, ob - ein sinnvoller Standardwert für eine Variable ist, die eigentlich eine Zahl ist. Für "undefiniert" oder "ungültig" würde ich eher None verwenden.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

umgesetzt

@LKuemmel LKuemmel merged commit 2a035c4 into openWB:master Mar 25, 2024
1 check passed
@LKuemmel LKuemmel deleted the fix_chargelog branch March 25, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants