~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Robert Collins
  • Date: 2010-06-25 06:23:08 UTC
  • mto: This revision was merged to the branch mainline in revision 5324.
  • Revision ID: robertc@robertcollins.net-20100625062308-qx287gzfrehs1d21
Restore the original ui_factory when existing BzrLibraryState.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
        BzrLibraryState directly.
165
165
    """
166
166
    import bzrlib.library_state
167
 
    return bzrlib.library_state.BzrLibraryState(setup_ui=setup_ui, stdin=stdin,
168
 
        stdout=stdout, stderr=stderr)
 
167
    if setup_ui:
 
168
        import bzrlib.ui
 
169
        stdin = stdin or sys.stdin
 
170
        stdout = stdout or sys.stdout
 
171
        stderr = stderr or sys.stderr
 
172
        ui_factory = bzrlib.ui.make_ui_for_terminal(stdin, stdout, stderr)
 
173
    else:
 
174
        ui_factory = None
 
175
    return bzrlib.library_state.BzrLibraryState(ui=ui_factory)
169
176
 
170
177
 
171
178
def test_suite():