-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added object to make patching pulses easier
- Loading branch information
1 parent
83f8412
commit 48c878f
Showing
5 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class PatchPulse(object): | ||
body = {} | ||
|
||
def __init__(self, pulse_id): | ||
self.pulse_id = pulse_id | ||
|
||
def add(self, key, element): | ||
if key not in self.body: | ||
self.body[key] = {} | ||
self.body[key]["add"] = element | ||
|
||
def remove(self, key, element): | ||
if key not in self.body: | ||
self.body[key] = {} | ||
self.body[key]["remove"] = element | ||
|
||
def set(self, name, value): | ||
self.body[name] = value | ||
|
||
def getBody(self): | ||
return self.body | ||
|
||
def getPulseId(self): | ||
return self.pulse_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters