webXMPP

Check-in [a33e6791c5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bring up notified.py client on actual UBports phone
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:a33e6791c5d2a81ded34786e2c297a7076ed3c72203e1cbb117e4857b56d4240
User & Date: vandyswa@gmail.com 2017-06-29 22:19:01
Context
2017-06-30
00:27
Merge branch 'master' of https://github.com/vandys/-webXMPP check-in: 4d5a71d733 user: vandyswa@gmail.com tags: master, trunk
2017-06-29
22:19
Bring up notified.py client on actual UBports phone check-in: a33e6791c5 user: vandyswa@gmail.com tags: master, trunk
18:29
Initial markups, actual phone notifications check-in: cea9e18da0 user: vandyswa@gmail.com tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to notified.py.

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
...
158
159
160
161
162
163
164




165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189

# Configuration, a DictOb
cfg = None

# DBus monitoring.  We need to know if the device is on/active, since
#  we only want to blink the LED if it's off (and only until it
#  goes back on)
is_locked = False
def dbus_watcher(*args, **kwargs):
    global blinking, is_locked

    dd = args[1]
    if "IsActive" not in dd:
        return
    is_locked = bool(dd["IsActive"])
................................................................................
        leds = True
    except:
        pass

# Start/stop blinking
def blink():
    global blinking
    set_led("rgb_start", "0")
    blinking = True
def unblink():
    global blinking
    set_led("rgb_start", "0")
    blinking = False

# Pull config out of JSON save format
................................................................................
    global gen, w, leds, blinking, is_locked

    inner = pak.inner
    w("Notification: gen %d -> %d\n" % (gen, inner["gen"]))
    for tup in inner["msgs"]:
        lt = len(tup)





        # No details at all, so just show one
        if lt == 0:
            n = notify2.Notification("New Message")
            n.show()
            break

        # Just who
        if lt == 1:
            n = notify2.Notification("New Message", tup[0])

        # Who plus headline 
        elif lt == 2:
            n = notify2.Notification(tup[0], tup[1])

        # Who plus headline plus body
        else:
            n = notify2.Notification(tup[0] + ": " + tup[1],
                tup[2])

        n.show()

    # Worry about the LEDs?
    if leds and (not blinking) and is_locked:
        blink()








|







 







|







 







>
>
>
>
|
|





|
|


|
|



|
|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
...
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193

# Configuration, a DictOb
cfg = None

# DBus monitoring.  We need to know if the device is on/active, since
#  we only want to blink the LED if it's off (and only until it
#  goes back on)
is_locked = True
def dbus_watcher(*args, **kwargs):
    global blinking, is_locked

    dd = args[1]
    if "IsActive" not in dd:
        return
    is_locked = bool(dd["IsActive"])
................................................................................
        leds = True
    except:
        pass

# Start/stop blinking
def blink():
    global blinking
    set_led("rgb_start", "1")
    blinking = True
def unblink():
    global blinking
    set_led("rgb_start", "0")
    blinking = False

# Pull config out of JSON save format
................................................................................
    global gen, w, leds, blinking, is_locked

    inner = pak.inner
    w("Notification: gen %d -> %d\n" % (gen, inner["gen"]))
    for tup in inner["msgs"]:
        lt = len(tup)

        # Ignore mirrors of our own sends on other devices
        if lt and (not tup[0]):
            continue

        # No details at all, so just show one notification
        if lt in (0, 1):
            n = notify2.Notification("New Message")
            n.show()
            break

        # Just who
        if lt == 2:
            n = notify2.Notification("New Message", tup[1])

        # Who plus headline 
        elif lt == 3:
            n = notify2.Notification(tup[1], tup[2])

        # Who plus headline plus body
        else:
            n = notify2.Notification(tup[1] + ": " + tup[2],
                tup[3])

        n.show()

    # Worry about the LEDs?
    if leds and (not blinking) and is_locked:
        blink()