GPG support is a perfect application for Python scripting in Mahogany.
GPG is a command-line tool.  Just call it directly from Python.  (Even
if you create nice Mahogany dialogs, ultimately they should just issue
command-line GPG calls.)

Python's os.popen2() call is a good candidate.  This type of call is
better than a raw os.exec().  It offers file/pipe pointers instead of
requiring huge command-line strings containing all data.

The promise of Python scripting drew me to Mahogany.  I'm not a
current user.  VZ just told me that Python scripting is no longer
really supported.  I will keep monitoring the project however.

Mark Evans


Very loose pseudo-code (no attempt at good Python/GPG syntax or
grammar):

import os;
{child_stdin, child_stdout} =
   popen2("gpg.exe --encrypt --recipient [EMAIL PROTECTED]\r");
fwrite(child_stdin,
   "a long message\nwith embedded special chars like \" and LF\n");
fclose(child_stdin);
result = "";
while(!foef(child_stdout))
   result += fread(child_stdout);
fclose(child_stdout);


See also
http://www.amk.ca/python/code/gpg.html



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-Users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-users

Reply via email to