Skip to content

Commit 991850f

Browse files
author
Robin
committed
launcher + usability
1 parent c1b065c commit 991850f

File tree

7 files changed

+18
-11
lines changed

7 files changed

+18
-11
lines changed

analyze

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env python3
2+
import analyzer.run

analyzer/notifier.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ async def start(self):
2525
self.transport, self.protocol = await self.loop.create_datagram_endpoint(
2626
lambda: NotifierProtocol(self.listeners),
2727
allow_broadcast=True,
28-
local_addr=(self.address, self.port),
29-
remote_addr=(self.publish_address, self.port)
28+
local_addr=(self.address, self.port)
3029
)
3130
self.logger.info(f"listening on '{cyan(self.address)}:{cyan(self.port)}' and "
3231
f"publishing on '{cyan(self.publish_address)}:{cyan(self.port)}'.")

analyzer/run.py

100644100755
+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
import argparse
23

34
from analyzer.learning import *
@@ -121,4 +122,8 @@ def plot(args):
121122
monitor_parser.set_defaults(func=monitor)
122123

123124
args = parser.parse_args()
124-
args.func(args)
125+
126+
if 'func' in args:
127+
args.func(args)
128+
else:
129+
parser.print_help()

generate

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd generator && node index.js $@ && cd ..

generator/browser/notifier.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ export class Notifier {
7171
message: message,
7272
exit: message === 'exit'
7373
}), this.port, this.ip);
74-
75-
return new Promise((resolve, reject) => {
74+
return new Promise((resolve, reject) => {
7675
let timeout = setTimeout(() => reject(`timed out waiting for notification ack.`), NOTIFY_TIMEOUT);
7776
this.callbacks.push({
7877
resolve: () => {
@@ -86,4 +85,4 @@ export class Notifier {
8685
});
8786
});
8887
}
89-
}
88+
}

generator/browser/sites/umo.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ export default class Umo extends Site {
2222
'/tobak-alkohol-droger/rokning/att-sluta-roka/',
2323
'/tobak-alkohol-droger/alkohol/dricka-for-mycket-eller-for-ofta/',
2424
'/tobak-alkohol-droger/droger/att-anvanda-droger/',
25-
//'/tobak-alkohol-droger/dopning/',
25+
'/tobak-alkohol-droger/dopning/',
2626

2727
'/sex/konssjukdomar/klamydia/',
2828
'/sex/konssjukdomar/kondylom/',
2929
'/sex/konssjukdomar/gonorre/',
3030
'/sex/konssjukdomar/syfilis/',
3131

32-
// all the links from the navigation menu.
32+
// all the links from the navigation menu.i
33+
/*
3334
'/kroppen/',
3435
'/kroppen/kroppen-ar-fantastisk/',
3536
'/kroppen/puberteten/',
@@ -119,7 +120,7 @@ export default class Umo extends Site {
119120
'/att-ta-hjalp/rattigheter-och-lagar/',
120121
'/att-ta-hjalp/1177-vardguidens-e-tjanster/',
121122
'/att-ta-hjalp/kopa-medicin-pa-natett/',
122-
'/att-ta-hjalp/vill-du-veta-det-senaste-om-coronaviruset-eller-covid-19/'
123+
'/att-ta-hjalp/vill-du-veta-det-senaste-om-coronaviruset-eller-covid-19/'*/
123124
];
124125
}
125-
}
126+
}

generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function monitor() {
9292

9393
async function parse(args) {
9494
if (actions.length === 0) {
95-
Logger.info('no actions specified, try -h for help.')
95+
parser.print_help()
9696
} else if (actions.length > 1) {
9797
Logger.error('please specify a single action.')
9898
} else {

0 commit comments

Comments
 (0)