aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/ui
Commit message (Collapse)AuthorAgeFilesLines
* command:serve_commands: new command for running a command server.W. Trevor King2012-08-241-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an initial step towards improving BE's efficiency. Previously, BE gets slow as the bug count increases for several commands (e.g. `be list`), because it takes time to load the bugdir information from disk at each invocation. If you use a remote repo (`be --repo http://localhost:8000/ list`), the server process may have already loaded the repo from disk, but now your listing process has to fetch everything over the wire. This is even worse than loading it from disk. With the new `be serve-commands` and `be --server URL ...` pair, the bugdir loading happens once on the server, and all the processing is also carried out on the server. This means that calls like `be --server http://localhost:8000/ list` will scale much better than other methods. For example: $ time be --server http://localhost:8000/ list > /dev/null real 0m2.234s user 0m0.548s sys 0m0.114s $ time be --server http://localhost:8000/ list > /dev/null real 0m0.730s user 0m0.548s sys 0m0.112s $ time be list > /dev/null real 0m2.453s user 0m2.289s sys 0m0.166s $ time be list > /dev/null real 0m2.521s user 0m2.350s sys 0m0.172s The first call to a cold server takes about the same time as a local call, because you need to load the bugs from the filesystem. However, later calls to a warm server are 3x faster, while later local calls are still slow. This is currently a minimal working implementation. There's a good deal of code in libbe.command.serve that I'd like to abstract out into a libbe.util library (since there's still a bunch of duplication between libbe.command.serve and libbe.command.serve_commands). The remote calls are also not as fast as I'd like, likely due to library load times. This commit just locks in an initial working implementation.
* util:http: pull HTTP helpers from libbe.storage.http into their own module.W. Trevor King2012-08-241-3/+3
| | | | This way they can be shared with the upcoming Command._run_remote.
* I changed my mind and fixed #/03d07e61#.W. Trevor King2012-02-251-1/+9
|
* Keep stdin (file descriptor 0) open in the pager's child process.W. Trevor King2012-02-251-1/+0
| | | | | | | | | This fixes the underlying problem that we worked around in commit 2c9ae15f53aef57d28091b237c193c653c6e80dd. Now even $ echo 'some bug | be --paginate new - will work instead of raising IOError: [Errno 9] Bad file descriptor.
* Add `new` to list of commands that should not default to using the pager.W. Trevor King2012-02-251-1/+1
| | | | | | | | | | | | | | | | | | If the command is run in the pager, access to stdin is tricky, so I avoid it by default. I'd just missed the fact that `new -` used stdin, which caused https://bugzilla.redhat.com/show_bug.cgi?id=751473 $ be new - Traceback (most recent call last): ... File "/usr/lib/python2.7/site-packages/libbe/command/new.py", line 89, in _run summary = self.stdin.readline() ... File "/usr/lib64/python2.7/codecs.py", line 473, in read newdata = self.stream.read(size) IOError: [Errno 9] Bad file descriptor
* Hide the traceback on InvalidURL errors.W. Trevor King2012-02-251-0/+5
| | | | | | | | | In response to https://bugzilla.redhat.com/show_bug.cgi?id=733945 in which Neal Becker was bummed at the long traceback, which may initially look like a programming issue.
* Ran update-copyright.py.W. Trevor King2012-02-166-60/+60
|
* Fix my busted 1512c0e2a64e patch to libbe/util/encoding.py.W. Trevor King2011-11-131-1/+1
| | | | | | | | | | | | | | Some temporary changes to encoding.py seem to have been added to commit 1512c0e2a64e19c8d4e5697257a4df5ddd8bc727 Author: W. Trevor King <wking@drexel.edu> Date: Tue Nov 8 07:14:43 2011 -0500 by accident. The initial change came from discussions with Niall Douglas, during which I realized that "filesystem encoding" ususally means the encoding for the *path*, not the *contents*. To avoid further confusion I'd renamed `get_filesystem_encoding` to the less ambiguous `get_text_file_encoding`. This commit should complete the transition.
* Fixed #/bc1e6ff4# (extra argument crash).W. Trevor King2011-09-071-2/+3
|
* Run update_copyright.py.W. Trevor King2011-05-256-6/+12
|
* Revive the UserError/UsageError distinctionW. Trevor King2011-05-021-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UsageError was removed back in commit bf3d434b244c57556bec979acbc658c30eb58221 Author: W. Trevor King <wking@drexel.edu> Date: Sat Dec 12 00:31:55 2009 -0500 Added libbe.command.base (with Command class)... because the distinction between UsageError and UserError was unclear. I've brought it back to satisfy a request by Christian Heinrich: On Sun, May 01, 2011 at 02:52:13AM +0200, Christian Heinrich wrote: > 3.) Using wrong syntax should receive better help messages. > > Current: > > "be new" -> ERROR: > Missing required argument SUMMARY > > Should be: > > "be new" -> usage: be new [options] SUMMARY > ... He suggested we print the full option list as well, but I've decided to just print the usage summary and remind the user how to get the full help message if they want it.
* get_fallback_fullname falls back to get_fallback_username if no interesting ↵W. Trevor King2011-04-141-2/+3
| | | | fullname is set.
* get_fallback_email() now uses the EMAIL environmental variable (if set).W. Trevor King2011-04-141-3/+2
| | | | | This patch is based on Julien Muchembled's suggestions, which are in turn based on the related Git code in git.git/ident.c.
* Add libbe.ui.util.user.get_fallback_fullname() and use pwd when possible.W. Trevor King2011-04-141-4/+26
| | | | This patch is based on Julien Muchembled's pwd suggestions.
* Fix command-line encoding processing.W. Trevor King2011-04-081-14/+32
| | | | | | | | | | | | | | | | | | | | | | | String command-line options are converted to unicode using the input encoding. We use the fact that Python sets up the original sys.stdout to determine the terminal encoding. This should fix Anders Sneckenborg's issues with Swedish characters: C:\temp\slask4>be new "Svenska tecken åäö" Created bug with ID 6be/5c3 C:\temp\slask4> C:\temp\slask4> C:\temp\slask4>be list ERROR: 'ascii' codec can't decode byte 0xe5 in position 15: ordinal not in range(128) You should set a locale that supports unicode, e.g. export LANG=en_US.utf8 See http://docs.python.org/library/locale.html for details
* Remove `--complete` from command-line completion unit test.W. Trevor King2011-02-221-1/+0
| | | | | | | | | | This should have been done alongside: commit b64851e3eb706b7b57503a0a605e0984e443747c Author: Robert Lehmann <mail@robertlehmann.de> Date: Fri Nov 26 08:34:35 2010 +0100 Exclude --complete from completion.
* Bumped to version 1.0.01.0.0Chris Ball2011-01-086-6/+6
|
* Ran update_copyright.pyW. Trevor King2010-06-226-75/+77
|
* Use os.path.join in libbe.storage.util.config.path.wking2010-06-221-1/+3
| | | | | | | | Versus previous hardcoded "~/.bugs_everywhere". Also improve docstrings for * libbe.storage.util.config.path * libbe.ui.util.user.get_user_id
* Use email.utils.formataddr/parseaddr to generate/parse user IDsW. Trevor King2010-02-071-29/+60
|
* Clearer UnicodeDecodeError message in command_line.dispatch().W. Trevor King2010-02-011-0/+8
| | | | | See #bea/e30# ("Where should the vcs-name and encoding configuration options live?") for details.
* Fix editor spawning on null-string EDITOR and VISUAL.W. Trevor King2010-01-291-4/+3
| | | | | $ EDITOR= VISUAL= python -c 'import os; import sys; print os.environ' {..., 'EDITOR': '', ..., 'VISUAL': '', ...}
* Strip footers (signatures) in be-mail-to-xmlW. Trevor King2010-01-201-1/+1
|
* Fixed `be help` (used to raise NotImplementedError)W. Trevor King2010-01-201-3/+11
|
* Add better help message on COMMAND-less be callW. Trevor King2010-01-201-1/+8
|
* Added libbe.command.serve and libbe.storage.http for HTTP backend.W. Trevor King2010-01-011-1/+1
| | | | | | | | | | Now the following works: some-BE-dir$ ./be serve $ ./be --repo http://localhost:8000 list I haven't come up with a clean idea for testing this yet, so other commands may be broken, but once we get the testing working, it shouldn't be too hard to get everything working over HTTP :).
* Updated copyright informationW. Trevor King2010-01-016-6/+48
|
* Merged be.restructure, major internal reorganization.W. Trevor King2009-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a bunch of classes to make the commands, user interfaces, and storage backends more abstract and distinct. This should make it much easier to extend and maintain BE. Features: * Directory restructured: becommands/ -> libbe/commands submods sorted by functionality. * Lots of new classes: Option, Argument, Command InputOutput, StorageCallbacks, UserInterface Storage * Consolidated ID handling in libbe.util.id * Transitioned VCS backends for Python-based VCSs from subprocess calss to internal python calls. Plus the user-visible changes: * New bugdir/bug/comment ID format replaces old bug:comment format. * Deprecated support for `be diff` on Arch and Darcs <= 2.3.1. A new backend abstraction (Storage) makes the former implementation ungainly. * Improved command completion. * Removed commands close, open, email_bugs, * Flipped some arguments `be assign BUG-ID [ASSIGNEE]` -> `be status ASSIGNED BUG-ID ...` `be severity BUG-ID SEVERITY` -> `be severity SEVERITY BUG-ID ...` `be status BUG-ID STATUS` -> `be status STATUS BUG-ID ...` In the merge: * Added 'commit' to list of pagerless commands. * Updated doc/README.dev See #bea86499-824e-4e77-b085-2d581fa9ccab/1100c966-9671-4bc6-8b68-6d408a910da1# for a discussion of why the changes were made and some of the difficulties en-route.
* Use fragment in base command completion + command io fixups.W. Trevor King2009-12-311-2/+5
|
* Added UserInterface and other improved abstractions for command handlingW. Trevor King2009-12-311-35/+43
|
* Removed libbe/ui/base.py. Basic UI definitions are in libbe/command/base.py.W. Trevor King2009-12-311-1/+0
|
* Don't worry about whitespace in `be --help`W. Trevor King2009-12-291-1/+1
|
* Remove libbe.ui.util.cmdutilW. Trevor King2009-12-291-129/+0
| | | | All of its functionality has moved off into more focused modules.
* Fixed up the completion helpers in libbe.command.utilW. Trevor King2009-12-291-4/+9
| | | | | | | | | | This entailed a fairly thorough cleanup of libbe.util.id. Remaining unimplemented completion helpers: * complete_assigned() * complete_extra_strings() Since these would require scanning all (active?) bugs to compile lists, and I was feeling lazy...
* Allow external use of Command.usage() and use CmdOptionParser.set_usage()W. Trevor King2009-12-281-1/+3
| | | | | | | | | | | | | This fixes $ python be diff -2 Usage: be [options] be: error: no such option: -2 and we now get the correct output $ python be diff -2 Usage: be diff [options] [REVISION] be: error: no such option: -2
* Restore comment stripping to libbe.ui.util.editor.editor_string()W. Trevor King2009-12-281-0/+4
|
* Don't run pager for the 'comment' command.W. Trevor King2009-12-281-7/+11
| | | | It may need access to the tty for the spawned editor.
* Moved InvalidStorageVersion from libbe.command to libbe.storageW. Trevor King2009-12-271-0/+4
| | | | | | Also added ConnectionError pretty-print to ui.command_line, storage version checking to BugDir.duplicate_bugdir(), and optional revision argument to Storage.storage_version().
* Fixed libbe.command.diff + ugly BugDir.duplicate_bugdir implementationW. Trevor King2009-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | duplicate_bugdir() works, but for the vcs backends, it could require shelling out for _every_ file read. This could, and probably will, be horribly slow. Still it works ;). I'm not sure what a better implementation would be. The old implementation checked out the entire earlier state into a temporary directory pros: single shell out, simple upgrade implementation cons: wouldn't work well for HTTP backens I think a good solution would run along the lines of the currently commented out code in duplicate_bugdir(), where a VersionedStorage.changed_since(revision) call would give you a list of changed files. diff could work off of that directly, without the need to generate a whole duplicate bugdir. I'm stuck on how to handle upgrades though... Also removed trailing whitespace from all python files.
* Transitioned target to Command-formatW. Trevor King2009-12-151-0/+2
|
* Transitioned tag to Command-formatW. Trevor King2009-12-151-1/+1
|
* Transitioned status to Command-formatW. Trevor King2009-12-141-5/+9
|
* Transitioned severity to Command-format, also added Command._get_*()W. Trevor King2009-12-142-31/+6
| | | | | | | | | | | | | | The old .requires_* thing was rediculous. The new ._get_*() callbacks allow the caller to provide a means for getting the expensive structures, which the command can use, or not, as required. This will also make it easier to implement the completion callbacks. The callbacks should probably have matching .set_*() methods, to avoid the current cache tweaking cmd._storage = ... etc. But that can wait for now...
* Transitioned help to Command-formatW. Trevor King2009-12-141-0/+1
|
* Transitioned import_xml to Command-formatW. Trevor King2009-12-141-1/+1
|
* Transitioned comment to Command formatW. Trevor King2009-12-142-18/+31
|
* Transitioned init to Command formatW. Trevor King2009-12-142-5/+7
|
* Added parse_user() calls to AssignW. Trevor King2009-12-141-4/+0
|
* Transitioned assign to Command formatW. Trevor King2009-12-141-4/+5
|
* More fixes for libbe.storage.vcs.hg + .git transition.W. Trevor King2009-12-131-6/+6
|