Skip to content

Commit fc2f47e

Browse files
committed
Added info text
1 parent 863b636 commit fc2f47e

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

yowsup-cli

+24-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ password=NDkxNTIyNTI1NjAyMkBzLndoYXRzYXBwLm5ldA==
2323
#######################################################
2424
"""
2525

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+
2642
logger = logging.getLogger("yowsup-cli")
2743

2844

@@ -77,6 +93,8 @@ class YowArgParser(argparse.ArgumentParser):
7793
sys.exit(0)
7894

7995

96+
def printInfoText(self):
97+
print(CR_TEXT.format(cliVersion=__version__, yowsupVersion=yowsup.__version__))
8098

8199
class RegistrationArgParser(YowArgParser):
82100
def __init__(self, *args, **kwargs):
@@ -118,7 +136,6 @@ class RegistrationArgParser(YowArgParser):
118136
action = "store",
119137
help = "Country code. See http://www.ipipi.com/networkList.do. This is now required")
120138

121-
122139
# configGroup.add_argument("-i", '--id',
123140
# action="store",
124141
# help = "Identity"
@@ -179,6 +196,7 @@ class RegistrationArgParser(YowArgParser):
179196

180197
def handleRequestCode(self, method, config):
181198
from yowsup.registration import WACodeRequest
199+
self.printInfoText()
182200
codeReq = WACodeRequest(config["cc"],
183201
config["phone"],
184202
config["mcc"],
@@ -192,6 +210,7 @@ class RegistrationArgParser(YowArgParser):
192210

193211
def handleRegister(self, code, config):
194212
from yowsup.registration import WARegRequest
213+
self.printInfoText()
195214
code = code.replace('-', '')
196215
req = WARegRequest(config["cc"], config["phone"], code)
197216
result = req.send()
@@ -273,6 +292,7 @@ class DemosArgParser(YowArgParser):
273292
if not credentials:
274293
print("Error: You must specify a configuration method")
275294
sys.exit(1)
295+
self.printInfoText()
276296
stack = cli.YowsupCliStack(credentials, not self.args["unmoxie"])
277297
stack.start()
278298

@@ -283,6 +303,7 @@ class DemosArgParser(YowArgParser):
283303
print("Error: You must specify a configuration method")
284304
sys.exit(1)
285305
try:
306+
self.printInfoText()
286307
stack = echoclient.YowsupEchoStack(credentials, not self.args["unmoxie"])
287308
stack.start()
288309
except KeyboardInterrupt:
@@ -297,6 +318,7 @@ class DemosArgParser(YowArgParser):
297318
sys.exit(1)
298319

299320
try:
321+
self.printInfoText()
300322
stack = sendclient.YowsupSendStack(credentials, [([self.args["send"][0], self.args["send"][1]])],
301323
not self.args["unmoxie"])
302324
stack.start()
@@ -311,6 +333,7 @@ class DemosArgParser(YowArgParser):
311333
print("Error: You must specify a configuration method")
312334
sys.exit(1)
313335
try:
336+
self.printInfoText()
314337
stack = contacts.YowsupSyncStack(credentials,self.args["sync"].split(','), not self.args["unmoxie"])
315338
stack.start()
316339
except KeyboardInterrupt:

0 commit comments

Comments
 (0)