-
Notifications
You must be signed in to change notification settings - Fork 229
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
misc: Add deviceid to configuration and enhance switchconfig #2175
Changes from all commits
ca5ca27
0d2be78
559863b
331f0d2
04487bf
7a69ab2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,6 +254,14 @@ class DeviceID(DeviceSymbol): | |
def default_value(self): | ||
return -1 | ||
|
||
def _arg_values(self, **kwargs): | ||
if self.name in kwargs: | ||
return {self.name: kwargs.pop(self.name)} | ||
elif configuration['deviceid'] != self.default_value: | ||
return {self.name: configuration['deviceid']} | ||
else: | ||
return {self.name: self.default_value} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't that what the original code did? I thought the idea was to keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, agree with Carlos here. We can't just return a (mutable) global value from |
||
|
||
|
||
class DeviceRM(DeviceSymbol): | ||
|
||
|
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.
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.
this has a slightly different effect, although I could write it more succinctly:
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.
actually,
configuration.update(**self.params)
doesn't work, since theupdate
method has a different meaning inconfiguration