~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-15 03:29:36 UTC
  • mfrom: (4960.3.1 499637-default-uifactory)
  • Revision ID: pqm@pqm.ubuntu.com-20100115032936-obafmsnn0d1ij450
(mbp) SilentUIFactory supports make_output_stream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
296
296
    def get_username(self, prompt, **kwargs):
297
297
        return None
298
298
 
 
299
    def _make_output_stream_explicit(self, encoding, encoding_type):
 
300
        return NullOutputStream(encoding)
 
301
 
299
302
    def show_error(self, msg):
300
303
        pass
301
304
 
361
364
 
362
365
    def log_transport_activity(self, display=False):
363
366
        pass
 
367
 
 
368
 
 
369
class NullOutputStream(object):
 
370
    """Acts like a file, but discard all output."""
 
371
 
 
372
    def __init__(self, encoding):
 
373
        self.encoding = encoding
 
374
 
 
375
    def write(self, data):
 
376
        pass
 
377
 
 
378
    def writelines(self, data):
 
379
        pass
 
380
 
 
381
    def close(self):
 
382
        pass