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=""): ...@@ -240,12 +240,7 @@ def sendMixMsg(dest, msg, subj="subject", test=False, chain=""):
raise MixError('Could not find mixmaster binary.') raise MixError('Could not find mixmaster binary.')
<<<<<<< HEAD
def writeMessage():
=======
def writeMessage(subject="", recipient="", text="", test=0): def writeMessage(subject="", recipient="", text="", test=0):
>>>>>>> added command line option for testing nyms
""" """
Create a message to be sent from nym Create a message to be sent from nym
The message has to be sent through a remailer chain The message has to be sent through a remailer chain
...@@ -255,7 +250,18 @@ def writeMessage(subject="", recipient="", text="", test=0): ...@@ -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" config['last_message'] = "ERROR - select your nym, actual selection HAS NOT a secret key"
menu() 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: while True:
subject = askSomething('Insert message subject: ') subject = askSomething('Insert message subject: ')
if isAscii(subject): if isAscii(subject):
...@@ -266,7 +272,7 @@ def writeMessage(subject="", recipient="", text="", test=0): ...@@ -266,7 +272,7 @@ def writeMessage(subject="", recipient="", text="", test=0):
continue continue
recipient = raw_input("Insert recipient email address or newsgroup name: ") recipient = raw_input("Insert recipient email address or newsgroup name: ")
=======
if subject == "": if subject == "":
while True: while True:
subject = askSomething('Insert message subject: ') subject = askSomething('Insert message subject: ')
...@@ -279,7 +285,6 @@ def writeMessage(subject="", recipient="", text="", test=0): ...@@ -279,7 +285,6 @@ def writeMessage(subject="", recipient="", text="", test=0):
if recipient == "": if recipient == "":
recipient = raw_input("Insert recipient email address or newsgroup name: ") recipient = raw_input("Insert recipient email address or newsgroup name: ")
>>>>>>> added command line option for testing nyms
if text == "": if text == "":
if X_is_running(): if X_is_running():
...@@ -299,8 +304,6 @@ def writeMessage(subject="", recipient="", text="", test=0): ...@@ -299,8 +304,6 @@ def writeMessage(subject="", recipient="", text="", test=0):
else: else:
print "msg has not been encrypted, public key for %s not found" % recipient print "msg has not been encrypted, public key for %s not found" % recipient
pressKey() pressKey()
else:
text = "Message:\n" + text
msg = "From: %s\n" % anym.name msg = "From: %s\n" % anym.name
if validateEmail(recipient): if validateEmail(recipient):
...@@ -330,21 +333,7 @@ def modifyConfig(): ...@@ -330,21 +333,7 @@ def modifyConfig():
pass 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=""): def chooseChain(chain=""):
>>>>>>> added command line option for testing nyms
""" Print remailer list and prompt for chain choice """ """ Print remailer list and prompt for chain choice """
if chain != "": if chain != "":
config['remailer_chain'] = [chain] config['remailer_chain'] = [chain]
...@@ -432,10 +421,14 @@ def main(): ...@@ -432,10 +421,14 @@ def main():
try: try:
if opts.test: if opts.test:
#setActiveNym(anym.name) if config['options']['testnym'] == "":
setActiveNym("1234@nymphet.paranoici.org") print bcolors.RED + "\nTestnym not configured in config.ini, exiting..." + bcolors.ENDC
parse_stats() sys.exit()
writeMessage(subject="prova", recipient="putro@autistici.org", text="asdadsfj", test=1) 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: else:
parse_stats() parse_stats()
menu() 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