forked from axel-angel/whatsapp-email-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhats-app-email-forwarder
executable file
·79 lines (55 loc) · 1.25 KB
/
whats-app-email-forwarder
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
HOME = (
os.path.dirname (
os.path.abspath (
__name__)))
sys.path.append (
"%s/third-party/pyyaml/lib" % (
HOME))
import yaml
with open ("%s/third-party/third-party-index" % HOME) as file_handle:
third_party_index = (
yaml.load (
file_handle))
for third_party_name, third_party_data \
in third_party_index.items ():
if not "python" in third_party_data:
continue
if third_party_name == "pyyaml":
continue
sys.path.append (
"%s/third-party/%s" % (
HOME,
third_party_data ["python"]))
import WhatsAppEmailForwarder as waforward
class Args (object):
pass
waforward.args = Args ()
waforward.args.debug = False
waforward.args.dry = False
waforward.config = (
waforward.loadConfig (
"config.yaml"))
print (
"== Starting")
whatsapp_config = (
waforward.config ["whatsapp"])
stack = (
waforward.YowsupMyStack (
(
whatsapp_config.get ("phone"),
whatsapp_config.get ("password"))))
print (
"== Connecting")
try:
stack.start ()
except KeyboardInterrupt:
print (
"== Terminated by user")
# ex: noet ts=4 filetype=yaml