Commit 2d01e244 authored by putro's avatar putro

fix after merge

parent c23ff3c2
......@@ -240,12 +240,7 @@ def sendMixMsg(dest, msg, subj="subject", test=False, chain=""):
raise MixError('Could not find mixmaster binary.')
<<<<<<< HEAD
def writeMessage():
=======
def writeMessage(subject="", recipient="", text="", test=0):
>>>>>>> added command line option for testing nyms
"""
Create a message to be sent from nym
The message has to be sent through a remailer chain
......@@ -255,7 +250,18 @@ def writeMessage(subject="", recipient="", text="", test=0):
config['last_message'] = "ERROR - select your nym, actual selection HAS NOT a secret key"
menu()
<<<<<<< HEAD
if subject == "":
while True:
subject = askSomething('Insert message subject: ')
if isAscii(subject):
break
else:
print "ERROR: subject contains not ascii characters, try again"
pressKey()
continue
if recipient == "":
recipient = raw_input("Insert recipient email address or newsgroup name: ")
while True:
subject = askSomething('Insert message subject: ')
if isAscii(subject):
......@@ -266,7 +272,7 @@ def writeMessage(subject="", recipient="", text="", test=0):
continue
recipient = raw_input("Insert recipient email address or newsgroup name: ")
=======
if subject == "":
while True:
subject = askSomething('Insert message subject: ')
......@@ -279,7 +285,6 @@ def writeMessage(subject="", recipient="", text="", test=0):
if recipient == "":
recipient = raw_input("Insert recipient email address or newsgroup name: ")
>>>>>>> added command line option for testing nyms
if text == "":
if X_is_running():
......@@ -299,8 +304,6 @@ def writeMessage(subject="", recipient="", text="", test=0):
else:
print "msg has not been encrypted, public key for %s not found" % recipient
pressKey()
else:
text = "Message:\n" + text
msg = "From: %s\n" % anym.name
if validateEmail(recipient):
......@@ -330,21 +333,7 @@ def modifyConfig():
pass
<<<<<<< HEAD
if checks.OptionsCheck(config) is True:
config['last_message'] = "OK, initial check passed"
if not nyms.sections:
print "No nyms configured, going to create it..."
createNym()
else:
setActiveNym(nyms.sections[0])
def chooseChain():
=======
def chooseChain(chain=""):
>>>>>>> added command line option for testing nyms
""" Print remailer list and prompt for chain choice """
if chain != "":
config['remailer_chain'] = [chain]
......@@ -432,10 +421,14 @@ def main():
try:
if opts.test:
#setActiveNym(anym.name)
setActiveNym("1234@nymphet.paranoici.org")
parse_stats()
writeMessage(subject="prova", recipient="putro@autistici.org", text="asdadsfj", test=1)
if config['options']['testnym'] == "":
print bcolors.RED + "\nTestnym not configured in config.ini, exiting..." + bcolors.ENDC
sys.exit()
else:
setActiveNym(config['options']['testnym'])
parse_stats()
writeMessage(subject="prova nymphet", recipient=config['options']['testnym_recipient'], text="asdadsfj", test=1)
print bcolors.GREEN + "\nTest message sent from nym %s to %s" % (config['options']['testnym'], config['options']['testnym_recipient'])
else:
parse_stats()
menu()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment