Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
Joining
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ffbs
Joining
Commits
67f8814c
Commit
67f8814c
authored
May 30, 2017
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more debug-output
parent
13a9f4be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
alfred.py
alfred.py
+3
-0
batadv.py
batadv.py
+3
-0
No files found.
alfred.py
View file @
67f8814c
...
...
@@ -7,11 +7,14 @@ import threading
def
sendData
(
channels
,
sock
,
serverAddress
):
for
channel
in
channels
:
print
(
"Sending data for Alfred-Channel: {}"
.
format
(
channel
))
p
=
subprocess
.
Popen
([
'/usr/local/bin/alfred-json'
,
'-z'
,
'-r'
,
channel
,
'-f'
,
'json'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
data
,
err
=
p
.
communicate
()
data
=
json
.
loads
(
data
.
decode
(
"utf-8"
))
.
values
()
print
(
"Alfred returned {} elements."
.
format
(
len
(
data
)))
for
d
in
data
:
m
=
json
.
dumps
(
d
)
message
=
json
.
dumps
([
"alfred"
,
str
(
channel
),
m
])
print
(
"Alfred: {}"
.
format
(
message
))
message
=
gzip
.
zlib
.
compress
(
bytes
(
message
,
'UTF-8'
))
sock
.
sendto
(
message
,
(
serverAddress
[
'ip'
],
serverAddress
[
'port'
]))
batadv.py
View file @
67f8814c
...
...
@@ -4,10 +4,13 @@ import gzip
import
json
import
time
import
threading
def
sendData
(
interface
,
sock
,
serverAddress
):
p
=
subprocess
.
Popen
([
'/usr/sbin/batadv-vis'
,
'-i'
,
interface
,
'-f'
,
'json'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
data
,
err
=
p
.
communicate
()
print
(
"Sending batadv-vis-data..."
)
for
line
in
data
.
splitlines
():
print
(
"Sending line: {}"
.
format
(
line
))
line
=
line
.
decode
(
'utf-8'
)
line
=
json
.
loads
(
line
)
message
=
json
.
dumps
([
"batadv-vis"
,
json
.
dumps
(
line
)])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment