summaryrefslogtreecommitdiff
path: root/src/cmdline
AgeCommit message (Collapse)AuthorFilesLines
2010-07-10Add a complete() routine to the download progress view that's invoked when ↵Daniel Burrows1-0/+10
the whole download process is complete. Necessary to fully expose the events generated by download_signal_log.
2010-07-10Flesh out the implementation of the download progress display and its tests.Daniel_Burrows@alumni.brown.edu2-25/+442
2010-07-10Split the teletype mock's constructors into default/nice/strict variants too.Daniel Burrows2-8/+49
2010-07-10Make transient_message a Mock and use its strict variant.Daniel Burrows1-1/+9
2010-07-10Make combining_terminal_output implement the same interface as Mock.Daniel Burrows2-5/+39
I can't use Mock directly because this class already inherits from Mock, so there would be confusion about which static members to expose (well, I could resolve it, but that's about as much trouble as implementing the interface directly).
2010-07-10Use Mock to implement terminal_with_combined_output.Daniel Burrows2-8/+3
2010-07-10Make the terminal_metrics mock a Mock instance and use its strict variant ↵Daniel Burrows2-8/+4
everywhere.
2010-07-10Make the terminal_locale mock a Mock instance and use its strict variant in ↵Daniel Burrows2-8/+4
the tests.
2010-07-10Make the terminal input class a Mock instance.Daniel Burrows2-8/+4
2010-07-10Make the terminal_output mock a Mock instance.Daniel Burrows2-8/+6
2010-07-10Have the teletype mark calls to the terminal's output() routine as expected.Daniel_Burrows@alumni.brown.edu1-2/+2
This eliminates the "uninteresting call" noise in the output.
2010-07-10Give mocks::terminal_input::prompt_for_input a default return value.Daniel Burrows1-1/+4
Otherwise tests will abort if it's invoked unexpectedly, instead of registering a failure and continuing.
2010-07-10Split the "terminal" interface into several interfaces that each export one ↵Daniel_Burrows@alumni.brown.edu43-438/+552
piece of its functionality. This will make some of the tests easier to write, since often some of the code requires just the ability to read the screen width, or just the ability to read input from the terminal. Splitting the terminal interface means no need to mock out the parts that aren't used.
2010-07-09A translator message has to be directly infront of the gettext callJens Seidel1-2/+2
2010-07-09Added a missing "\n" in a message for consistencyJens Seidel1-1/+1
2010-07-03Move the throttle object to src/generic/util.Daniel_Burrows@alumni.brown.edu9-243/+24
2010-07-03Move the core command-line progress view interface to generic/views.Daniel_Burrows@alumni.brown.edu9-110/+41
2010-07-02Remove the now-obsolete preserve_and_advance() routine.Daniel Burrows3-19/+0
Its only real purpose was to do what display_and_advance() does better -- i.e., display a durable progress notification and move to the next line.
2010-07-02Use display_and_advance() for the standard progress meters.Daniel Burrows1-8/+6
2010-07-02Add a routine on transient_message to display a non-wrapped message and move ↵Daniel Burrows3-0/+27
to the next line. This should be useful for things like printing a status message alongside some sort of progress indicator -- set_text() followed by advance() is not really ideal since it truncates the line.
2010-06-30Add a view interface for displaying the download progress and an ↵Daniel_Burrows@alumni.brown.edu3-0/+188
implementation for showing the download progress at the command line and a stub implementation. This is mostly just a streamlining of the apt interface, but putting the code behind a clean view will also make it much more testable.
2010-06-15Invoke the new done() routine when finished with searches and when finished ↵Daniel Burrows3-3/+3
with operations that use the OpProgress implementation.
2010-06-15Add support to the command-line progress display object for showing that the ↵Daniel Burrows4-15/+117
current task is done, and for displaying progress the way classic apt tools do. The new code supports both "[ 40%] Task" and "Task... 40%" display styles, and when a task is complete the code will either erase it (default) or advance to the next terminal line (like apt-get does). These behaviors are controlled by apt options.
2010-06-10Add support in the transient message for making a message permanent and ↵Daniel Burrows3-0/+19
advancing to the next line. i.e., for explicitly outputting a newline. The main advantage of this is that it lets me give the progress display a mode that emulates the old apt progress display (specifically, the behavior that completed steps remain visible).
2010-06-10Fix the teletype mock to only output set_last_line() when the last line has ↵Daniel Burrows1-31/+28
actually changed. In particular, this means that outputting "\n" after a flush won't redundantly update the last line.
2010-06-10Don't show any output from the transient message object if the output device ↵Daniel Burrows2-1/+18
isn't a terminal.
2010-06-10Add a doccomment for create_transient_message.Daniel Burrows1-0/+5
2010-06-10Mock out progress_throttle and progress_display.Daniel Burrows4-0/+97
2010-06-09Add a simple mock of the transient message class.Daniel Burrows3-1/+55
2010-06-09Display a "disabled" progress indicator ("[----]") for pulse() instead of ↵Daniel Burrows1-1/+1
just whitespace.
2010-06-08Use cmdline::progress_display to display startup progress too.Daniel_Burrows@alumni.brown.edu2-18/+19
This means that all the progress messages will have the same format, which I hope is useful.
2010-06-08When updating a progress bar, update it if the percentage-complete has changed.Daniel_Burrows@alumni.brown.edu1-0/+4
2010-06-08Drop the "force" parameter to progress_display::set_progress; it doesn't ↵Daniel_Burrows@alumni.brown.edu5-31/+15
seem to be necessary and it clutters things up.
2010-06-08Reuse the progress_display interface for the search_progress code.Daniel_Burrows@alumni.brown.edu4-51/+100
2010-06-08Fix the progress-throttling code.Daniel_Burrows@alumni.brown.edu1-1/+1
It was saying to update only if *not enough* time had passed.
2010-06-08Factor the progress update throttling code into a separate class.Daniel_Burrows@alumni.brown.edu10-19/+203
2010-06-08Use the new progress stuff to get progress indicators from "search" and ↵Daniel_Burrows@alumni.brown.edu4-21/+113
"versions". Note that they currently display progress information even if stdout is not a tty, which really needs to be fixed.
2010-06-08Add a first draft of some wrapper code to display search progress events.Daniel_Burrows@alumni.brown.edu4-0/+124
The design needs to be improved, but it's a proof-of-concept. The wrapper takes care of displaying which pattern is being searched for as part of the displayed progress message. This has the side effect of causing the construction of progress messages to be a substantial fraction of the overall run-time. The API needs to be redesigned so that messages are only formatted when they'll actually be displayed.
2010-06-08dd some generic code to display a progress indicator on a single line.Daniel_Burrows@alumni.brown.edu4-0/+211
This is just a slightly higher-level wrapper around the transient message class. Preliminary work with this suggests that the progress_info API might need a redesign; I see a significant slowdown when using this to report progress. I don't think this is insurmountable; I just need to be sure that I actually handle it before I push the code that uses this into "master".
2010-06-07Fix the transient message's screen width logic to behave properly when a ↵Daniel Burrows1-3/+10
wide character runs over the edge of the terminal.
2010-06-07Instead of using ON_CALL() to add the write-combining behavior to the fake ↵Daniel Burrows1-9/+10
terminal, just override the interface methods. This way, other code can connect to them via ON_CALL() without breaking the combining terminal. For instance, the teletype does this.
2010-06-07Ignore all the terminal output functions by default when using a teletype mock.Daniel Burrows1-2/+6
2010-06-07Add a matcher that compares strings by trimming them on the right.Daniel Burrows1-0/+7
With terminal output, we usually know how much space should exist on the left, just not the right.
2010-06-07Don't try to output the comparison string from StrTrimmedEq.Daniel Burrows1-1/+1
Contrary to the documentation, doing this produces a fatal exception.
2010-06-07Wrap a layer of indirection around wcwidth().Daniel Burrows20-40/+167
This is necessary so that I can test the behavior of terminal output routines that care about string widths, without depending on system locale settings or data.
2010-06-06Fix the teletype mock object to handle characters that occupy two cells.Daniel Burrows1-34/+102
2010-06-06Fix up the includes of text_progress.cc to match the new style.Daniel Burrows1-2/+4
2010-06-06Use wide strings in the terminal wrapper interface.Daniel Burrows9-43/+58
This will make it easier to deal with wide characters properly in the rest of the code. I've also found in the other interfaces that it's just a good idea to use wide strings, to avoid accidentally forgetting a conversion on I/O.
2010-06-06Use the terminal object to generate output from transient_message.Daniel Burrows1-4/+7
This will allow the terminal object to be mocked out for unit tests.
2010-06-05Add a convenience matcher to trim whitespace from strings before matching them.Daniel Burrows1-0/+15
Since output to the terminal often paints spaces to erase characters, this should be useful when testing the terminal-handling code, although it obviously doesn't cover every case.