aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Adjusted final commit-handling in be-handle-mail.W. Trevor King2009-07-191-8/+9
| | | | | | | | Now the final commit will run whether or not the preceding commands raise any exceptions. Note that since we've added the "--allow-empty" to "be commit", we don't need to worry about empty commits after read-only actions.
* Oops, _now_ I've fixed the multipart generation in be-handle-mailW. Trevor King2009-07-191-3/+3
|
* Merged "be commit --allow-empty from be.wtk-rr"W. Trevor King2009-07-199-50/+118
|\
| * Added --allow-empty to "be commit"W. Trevor King2009-07-199-49/+117
| | | | | | | | | | | | | | Previously many backends would silently add an empty commit. Not very useful. When the new --allow-empty flag and related allow_empty options are false, every versioning backend is guaranteed to raise the EmptyCommit exception in the case of an attempted empty commit.
* | Fixed multipart bug in be-handle-mail.Message.response_email()W. Trevor King2009-07-191-5/+4
| | | | | | | | | | I hadn't attached the mutipart body to the .response_header, which meant that the reply lacked target email addresses, etc.
* | Added --disable-autocommit to be-handle-mail.W. Trevor King2009-07-191-1/+15
| | | | | | | | Also restored repsonse-message logging to help track down bugs.
* | be-handle-mail now commits after every successful email execution.W. Trevor King2009-07-191-7/+13
| | | | | | | | | | | | | | | | | | Caveats: It will produce blank commits after emails that make no changes. Todo: --fail-on-null option to "be commit" It will not commit changes due to emails that are partly successful. Todo: add "be revert"
* | Merged becommands/commit.py addition from be.wtk-rr.W. Trevor King2009-07-194-4/+73
|\|
| * Added becommands/commit.py and minor fixes.W. Trevor King2009-07-194-4/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we can commit changes from the command line with a unified interface. The interface is much less flexible than using your particular version control system's commit command directly, so this command is mostly intended for user-interfaces and other tools that don't want to be bothered with the extra flexibility. Normalized spacing in rcs.RCS.commit to produce: summary <BLANKLINE> body <TRAILING-ENDLINE> messages regardless of the input string format. Also fixed a "--complete" handline bug in cmdutil, and some minor docstring typos in libbe.rcs and .editor.
* | Added more allowed commands and pseudo-headers to be-handle-mail.W. Trevor King2009-07-191-3/+5
| | | | | | | | The new pseudo-headers are currently ignored.
* | Added interfaces/README with commit-deletion notes.W. Trevor King2009-07-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Up to now, my email interface never committed automatically, in order to avoid locking in inappropriate changes. However, with the ability to modify bug status, etc., it could be hard to determine the correct status with a single email's effects removed. In order to make that easier, I'm switching over to a "auto-commit after every user action" model, and I've looked up the incantations for commit deletion for bzr and git (the VCSs I use). These incantations are recorded in interfaces/README. Next up: add auto-commit functionality.
* | be-handle-mail's new DBT-style interface handles the example emails now.W. Trevor King2009-07-193-31/+58
| |
* | Reworked be-handle-mail to be more like the Debian Bug Tracker.W. Trevor King2009-07-1911-102/+192
| | | | | | | | | | Changed all the example emails over to the new format. Now it's time to try them all out and fix all the bugs ;).
* | Generalized _procmailrc to allow several tags: [be-bug...W. Trevor King2009-07-191-1/+1
| | | | | | | | | | | | | | | | | | This is part of a process to make the email interface more like the Debian Bug Tracker's. http://www.debian.org/Bugs/Reporting _procmailrc had been out of date anyway, [be-mail] should have been [be-bug].
* | Added new_with_comment ability to be-handle-mail.W. Trevor King2009-07-182-4/+51
| | | | | | | | | | Waiting for a response so you can get the bug ID for your initial comment is silly. Now you don't have to :)
* | Assorted bugfixes to get reworked be-handle-mail working.W. Trevor King2009-07-182-21/+27
| |
* | Major be-handle-mail rewrite to make things more modular.W. Trevor King2009-07-182-173/+269
| | | | | | | | | | Added Command and Message classes, and use new flexibility in send_pgp_mime.py.
* | Oops, forgot to reset from/to_addr in send_pgp_mime.py unittestsW. Trevor King2009-07-181-2/+2
| |
* | Major send_pgp_mime.py reorganization to better integrate with email.Message.W. Trevor King2009-07-181-119/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now send_pgp_mime.py passes it's unittests again, and it should be easier to use from be-handle-mail :). Renamed Mail -> EncryptedMessageFactory, since its role is to generate message bodies of various types (plain, signed, encrypted, ...) Separated the header processing from Mail, now you need to header_from_text() your header text to create an email.Message which you can use in EncrypedMessageFactory.sign(), .encrypt(), ... Once you've created the body message you want, you can attach it to the header with attach_root(header, root_part) where both header and root_part are email.Message instances. Made EncryptedMessageFactory doctests more robust, through the use of # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE which removed the need for the .strip*() methods. Also added the configurable from_addr and to_addr, which allows you to run the doctests with successful gpg calls. Just set them to some address from your private keyring, and pass the passphrase for that key in to your test via a file (or gpg-agent...) python send_pgp_mime.py -tP path/to/pasphrase/file
* | Starting to seperate message handling in be-handle-mail.W. Trevor King2009-07-181-25/+37
| | | | | | | | | | The goal being to make handling commands differently easier, rather than just passing off the whole interface to becommands.
* | Normalized whitespace in be-handle-mail and send_pgp_mime.py.W. Trevor King2009-07-182-39/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also removed "commit after every message" from be-handle-mail, because a) not implemented yet b) don't want to commit spam, since we'd have to find a way to remove it later. Suggested future workflow: * "bzr diff" to poll for activity, blank output = no activity. * on activity: 1) look at changes 2) remove whatever 3) commit email-interface repo. 4) merge changes into your private repo * on private repo changes: * if activity in email-interface repo: 1) deal with email activity as above * push your private repo onto the email-interface repo (and update the email repos' working tree, if required)
* | be-handle-mail now handles non-text comments.W. Trevor King2009-07-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | This required replacing both the codec-wrapped sys.stdin _and_ the raw sys.__stdin__ with StringIO(stdin). becommands/comment will use only one or the other depending on the comment's content type. Caveat: Get_body_type only grabs the body and type of the first non-mulitpart section, which may not be what the user expects. Todo: Add multiple comments for each part of a multipart message, like we do in interfaces/xml/be-mbox-to-xml.
* | In be-handle-mail, don't mess with stdin if the command doesn't need it.W. Trevor King2009-07-181-4/+6
| | | | | | | | This fixes problems with StringIO(None).
* | In be-handle-mail, give new bug summary via command line.W. Trevor King2009-07-181-2/+3
| | | | | | | | | | | | Fixes incorrect implementation of _comment_ bodies via stdin in my wking@drexel.edu-20090718143517-mkd6toxmcoij3qwk commit.
* | Merged some bugfixes from be.wtk-rrW. Trevor King2009-07-182-1/+2
|\|
| * Import sys in becommands/new.py.W. Trevor King2009-07-181-0/+1
| | | | | | | | Required for reading the bug summary string from stdin.
| * Fixed broken path in libbe.rcs.RCS._rcs_get_file_contents(binary=True).W. Trevor King2009-07-181-1/+1
| | | | | | | | | | | | I'd forgotten to prefix the directory root, so calling be show --only-raw-body COMMIT-ID would fail if you weren't executing it in the repository root.
* | For be-handle-mail, pass comment body in via a temporary stdin.W. Trevor King2009-07-181-3/+9
| | | | | | | | | | This avoids decode-recode issues inside libbe.cmdutil.execute(), as well as problems due to large comment bodies.
* | Corrected author_addr -> info["author_addr"] in be-handle-mailW. Trevor King2009-07-181-2/+2
| |
* | Fixed typo in one of be-handle-mail's InvalidCommand calls.W. Trevor King2009-07-182-3/+3
| | | | | | | | | | Also restored Makefile target to home (from local), which I'd accidentally committed two commits ago...
* | Allow external override of libbe.encoding.get_encoding().W. Trevor King2009-07-182-2/+7
| | | | | | | | | | | | The previous procmail encoding fix failed, because the becommand execution checks libbe.encoding.get_encoding() on it's own, and got the procmail encoding. This one works.
* | Fixed some missing references in be-handle-mail.InvalidSubjectW. Trevor King2009-07-182-4/+4
| |
* | Hardcoded UTF-8 encoding in be-handle-mail.W. Trevor King2009-07-181-2/+4
| | | | | | | | | | | | | | When run by procmail, the encoding returned by libbe.encoding.get_encoding is ANSI_X3.4-1968, which chokes on unicode output. I can't think of a more elegant solution than hardcoding in the default encoding.
* | Added "to_unicode" to send_pgp_mime.flatten()W. Trevor King2009-07-182-6/+10
| | | | | | | | | | | | | | | | | | | | | | be-handle-mail wants unicode output, since all it's internal processing is done with unicode. However, the flatten calls in send_pgp_mime work with the encoded binary string output, and execute(sendmail, stdin=flatten(msg, to_unicode=True)) fails with Exception: u while executing /usr/sbin/sendmail -t sendmail: fatal: wking(1001): No recipient addresses found in message header
* | send_pgp_mime.py attempts to avoid UTF-8 for MIMEText messages.W. Trevor King2009-07-182-5/+24
| | | | | | | | | | | | This keeps the transfer-encoding out of base64 if possible. Also added a "help" example to interafaces/email/interactive/examples.
* | Added send_pgp_mime.Mail.encodedMIMEText() for unicode handling.W. Trevor King2009-07-182-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now be-handle-mail handles examples/unicode without crashing cat examples/unicode | ./be-handle-mail -o -l - But the output email is encoded in base64: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 From: BE Bugs <wking@thor.physics.drexel.edu> To: John Doe <jdoe@example.com> Date: Sat, 18 Jul 2009 12:22:05 +0000 Subject: [be-bug] Re: show In-reply-to: <abcd@example.com> UmVzdWx0cyBvZiBydW5uaW5nOiAoZXhpdCBjb2RlIDApCiAgc2hvdyAKCnN0ZG91dDoKCjw/eG1s IHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiA/Pgo8YnVnPgogIDx1dWlkPmY3Y2NkOTE2 LWI1YzctNDg5MC1hMmUzLThjOGFjZTE3YWUzYTwvdXVpZD4KICA8c2hvcnQtbmFtZT5mN2M8L3No b3J0LW5hbWU+CiAgPHNldmVyaXR5Pm1pbm9yPC9zZXZlcml0eT4KICA8c3RhdHVzPmZpeGVkPC9z ... This is perhaps the best we can get out of python < 3.1/2.7, see http://bugs.python.org/issue1368247
* | Fixed options.logfile -> logpath typo in be-handle-mail.open_logfile().W. Trevor King2009-07-181-1/+1
| |
* | Better unicode handling in be-handle-mail.W. Trevor King2009-07-181-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | be-handle-mail now gets a bit further on cat examples/unicode | ./be-handle-mail -o -l - 2>&1 1>/dev/null It successfully reads in unicode output from the command execution and successfully prints that output to the log ("-l - 2>&1 1>/dev/null" sets up the log to be printed to the terminal's stdout). However, it chokes later on with responding to John Doe <jdoe@example.com>: show Traceback (most recent call last): File "./be-handle-mail", line 274, in <module> main() File "./be-handle-mail", line 266, in main response_email = compose_response(ret, out_text, err_text, info).plain() File "./be-handle-mail", line 210, in compose_response LOGFILE.write("\n%s\n\n" % send_pgp_mime.flatten(response_email.plain())) File "/home/wking/src/fun/be/be.email/interfaces/email/interactive/send_pgp_mime.py", line 165, in flatten g.flatten(msg) File "/usr/lib/python2.5/email/generator.py" ... ... UnicodeEncodeError: 'ascii' codec can't encode character u'\ufffd' in position 2581: ordinal not in range(128)
* | Added tracebacks to be-handle-mail's "uncaught exceptions".W. Trevor King2009-07-181-1/+2
| |
* | Added an email interface example requesting unicode comment output.W. Trevor King2009-07-171-0/+9
| | | | | | | | Indeed, be-handle-mail chokes... :(
* | Added "be-handle-mail --logfile LOGFILE" for sane logfile handling.W. Trevor King2009-07-171-13/+43
| | | | | | | | | | The previous setup had been pretty wimpy; now there's a degree of flexibility.
* | Added symlinks to libbe and becommands in interfaces/email/interactive.W. Trevor King2009-07-172-0/+2
| | | | | | | | | | With this set-up, be-handle-mail run from its own directory will load your working-state BE setup, not your system-wide BE installation.
* | Setup be-handle-mail.BE_DIR to point to the BE repo by default.W. Trevor King2009-07-171-1/+1
| | | | | | | | | | | | | | At least, it points to the directory where be-handle-mail lives. If you haven't moved it, that will be somewhere inside the BE repository. This removes my hardcoded BE_DIR.
* | "be-handle-mail --output" added to support easy testing.W. Trevor King2009-07-171-2/+14
| |
* | Removed debugging reply-address adjustment from be-handle-mail.W. Trevor King2009-07-161-1/+0
| | | | | | | | Everything seems to be working now. On to the remote tests ;).
* | be-hand-mail now catches errors and sends appropriate responses.W. Trevor King2009-07-161-27/+94
| |
* | Now be-handle-mail successfully catches stdout/stderr.W. Trevor King2009-07-161-1/+2
| |
* | Renamed test->manipulate_encodings in becommands.*.execute.W. Trevor King2009-07-1619-92/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reminder from my initial libbe/encoding.py commit: Because of the stdout replacement, the doctests executes now need an optional 'test' argument to turn off replacement during the doctests, otherwise doctest flips out (since it had set up stdout to catch output, and then we clobbered it's setup). I'm also trying to catch stdout/stderr from be-handle-mail, and I ran into the same problem. It took me a bit to remember exactly what "test" was supposed to do, so I thought I'd make the argument name more specific. If you need other changes when running in "test" mode, you'll have to add other kwargs.
* | Oops again, removed some old debugging loggingW. Trevor King2009-07-151-8/+0
| |
* | Oops, the header keys in be-handle-mail should all be unicode.W. Trevor King2009-07-151-4/+4
| | | | | | | | | | Even though I convert to ascii in send_pgp_mime.Mail.__init__(), it's still good to be consistent inside each module ;).