-
Notifications
You must be signed in to change notification settings - Fork 81
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
fix chargelog #1483
Conversation
@@ -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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"?
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 "-" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
umgesetzt
No description provided.