Skip to content

Instantly share code, notes, and snippets.

@typesupply
Created March 16, 2020 01:37
Show Gist options
  • Save typesupply/59cf4031b7db71a453002b6fa84718c7 to your computer and use it in GitHub Desktop.
Save typesupply/59cf4031b7db71a453002b6fa84718c7 to your computer and use it in GitHub Desktop.
from mojo import events
import metricsMachine
class MMCurrentPairObserver(object):
def __init__(self):
self.previousPair = None
events.addObserver(
self,
"currentPairChangedCallback",
"MetricsMachine.currentPairChanged"
)
def currentPairChangedCallback(self, info):
pair = info["pair"]
if pair == self.previousPair:
return
self.previousPair = pair
print(pair)
MMCurrentPairObserver()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment