@@ -23,6 +23,22 @@ password=NDkxNTIyNTI1NjAyMkBzLndoYXRzYXBwLm5ldA==
23
23
#######################################################
24
24
"""
25
25
26
+
27
+ CR_TEXT = """yowsup-cli v{cliVersion}
28
+ yowsup v{yowsupVersion}
29
+
30
+ Copyright (c) 2012-2016 Tarek Galal
31
+ http://www.openwhatsapp.org
32
+
33
+ This software is provided free of charge. Copying and redistribution is
34
+ encouraged.
35
+
36
+ If you appreciate this software and you would like to support future
37
+ development please consider donating:
38
+ http://openwhatsapp.org/yowsup/donate
39
+
40
+ """
41
+
26
42
logger = logging .getLogger ("yowsup-cli" )
27
43
28
44
@@ -77,6 +93,8 @@ class YowArgParser(argparse.ArgumentParser):
77
93
sys .exit (0 )
78
94
79
95
96
+ def printInfoText (self ):
97
+ print (CR_TEXT .format (cliVersion = __version__ , yowsupVersion = yowsup .__version__ ))
80
98
81
99
class RegistrationArgParser (YowArgParser ):
82
100
def __init__ (self , * args , ** kwargs ):
@@ -118,7 +136,6 @@ class RegistrationArgParser(YowArgParser):
118
136
action = "store" ,
119
137
help = "Country code. See http://www.ipipi.com/networkList.do. This is now required" )
120
138
121
-
122
139
# configGroup.add_argument("-i", '--id',
123
140
# action="store",
124
141
# help = "Identity"
@@ -179,6 +196,7 @@ class RegistrationArgParser(YowArgParser):
179
196
180
197
def handleRequestCode (self , method , config ):
181
198
from yowsup .registration import WACodeRequest
199
+ self .printInfoText ()
182
200
codeReq = WACodeRequest (config ["cc" ],
183
201
config ["phone" ],
184
202
config ["mcc" ],
@@ -192,6 +210,7 @@ class RegistrationArgParser(YowArgParser):
192
210
193
211
def handleRegister (self , code , config ):
194
212
from yowsup .registration import WARegRequest
213
+ self .printInfoText ()
195
214
code = code .replace ('-' , '' )
196
215
req = WARegRequest (config ["cc" ], config ["phone" ], code )
197
216
result = req .send ()
@@ -273,6 +292,7 @@ class DemosArgParser(YowArgParser):
273
292
if not credentials :
274
293
print ("Error: You must specify a configuration method" )
275
294
sys .exit (1 )
295
+ self .printInfoText ()
276
296
stack = cli .YowsupCliStack (credentials , not self .args ["unmoxie" ])
277
297
stack .start ()
278
298
@@ -283,6 +303,7 @@ class DemosArgParser(YowArgParser):
283
303
print ("Error: You must specify a configuration method" )
284
304
sys .exit (1 )
285
305
try :
306
+ self .printInfoText ()
286
307
stack = echoclient .YowsupEchoStack (credentials , not self .args ["unmoxie" ])
287
308
stack .start ()
288
309
except KeyboardInterrupt :
@@ -297,6 +318,7 @@ class DemosArgParser(YowArgParser):
297
318
sys .exit (1 )
298
319
299
320
try :
321
+ self .printInfoText ()
300
322
stack = sendclient .YowsupSendStack (credentials , [([self .args ["send" ][0 ], self .args ["send" ][1 ]])],
301
323
not self .args ["unmoxie" ])
302
324
stack .start ()
@@ -311,6 +333,7 @@ class DemosArgParser(YowArgParser):
311
333
print ("Error: You must specify a configuration method" )
312
334
sys .exit (1 )
313
335
try :
336
+ self .printInfoText ()
314
337
stack = contacts .YowsupSyncStack (credentials ,self .args ["sync" ].split (',' ), not self .args ["unmoxie" ])
315
338
stack .start ()
316
339
except KeyboardInterrupt :
0 commit comments