|
71 | 71 | >>> URL = 'clumsy-clementine'
|
72 | 72 | >>> S = firebase.subscriber(URL, pprint) # pprint will be called on all Firebase updates
|
73 | 73 | >>> S.start() # will get called with initial value of URL, which is empty
|
74 |
| -{u'data': None, u'path': u'/'} |
| 74 | +(u'put', {u'data': None, u'path': u'/'}) |
75 | 75 |
|
76 | 76 | >>> firebase.put(URL, ';-)') # will make S print something
|
77 |
| -{u'data': u';-)', u'path': u'/'} |
| 77 | +(u'put', {u'data': u';-)', u'path': u'/'}) |
78 | 78 |
|
79 | 79 | >>> firebase.put(URL, {'status': 'mortified'}) # continuing from above
|
80 |
| -{u'data': {u'status': u'mortified'}, u'path': u'/'} |
81 |
| ->>> firebase.patch(URL, {'reason': 'blushing'}) # this one is scary |
82 |
| -{u'data': {u'reason': u'blushing'}, u'path': u'/'} |
83 |
| ->>> print firebase.get(URL) # notice the update only gave us the new k,v without telling us |
84 |
| -{u'status': u'mortified', u'reason': u'blushing'} |
85 |
| - |
86 |
| ->>> firebase.put(URL, {'color': 'orange-red'}) # expect change from S |
87 |
| -{u'data': {u'color': u'orange-red'}, u'path': u'/'} |
88 |
| ->>> print firebase.get(URL) # put overwrites, but S doesn't tell us! |
89 |
| -{u'color': u'orange-red'} |
| 80 | +(u'put', {u'data': {u'status': u'mortified'}, u'path': u'/'}) |
| 81 | +>>> firebase.patch(URL, {'reason': 'blushing'}) # same data, different method |
| 82 | +(u'patch', {u'data': {u'reason': u'blushing'}, u'path': u'/'}) |
90 | 83 |
|
91 | 84 | >>> firebase.put(URL + '/color', 'red')
|
92 |
| -{u'data': u'red', u'path': u'/color'} |
| 85 | +(u'put', {u'data': u'red', u'path': u'/color'}) |
93 | 86 |
|
94 | 87 | >>> S.stop()
|
95 | 88 | ```
|
|
0 commit comments