Did I find the right examples for you? yes no

All Samples(37)  |  Call(31)  |  Derive(0)  |  Import(6)

        def write_string(s, out=None, encoding=None):
    if out is None:
        out = sys.stderr
    assert type(s) == compat_str

    if sys.platform == 'win32' and encoding is None and hasattr(out, 'fileno'):
        if _windows_write_string(s, out):
            return

    if ('b' in getattr(out, 'mode', '') or
            sys.version_info[0] < 3):  # Python 2 lies about mode of sys.stderr
        byt = s.encode(encoding or preferredencoding(), 'ignore')
        out.write(byt)
    elif hasattr(out, 'buffer'):
        enc = encoding or getattr(out, 'encoding', None) or preferredencoding()
        byt = s.encode(enc, 'ignore')
        out.buffer.write(byt)
    else:
        out.write(s)
    out.flush()
        


src/y/o/youtube_dl-2014.04.30.1/youtube_dl/YoutubeDL.py   youtube_dl(Download)
    import ctypes
 
from .utils import (
    compat_cookiejar,
    compat_http_client,
    def _write_string(self, s, out=None):
        write_string(s, out=out, encoding=self.params.get('encoding'))
 
    def to_stdout(self, message, skip_eol=False, check_quiet=False):
        """Print message to stdout if not in quiet mode."""
 
        write_string(
            '[debug] Encodings: locale %s, fs %s, out %s, pref %s\n' % (
                locale.getpreferredencoding(),
                sys.getfilesystemencoding(),

src/y/o/youtube-dl-HEAD/youtube_dl/YoutubeDL.py   youtube-dl(Download)
    import ctypes
 
from .utils import (
    compat_cookiejar,
    compat_http_client,
    def _write_string(self, s, out=None):
        write_string(s, out=out, encoding=self.params.get('encoding'))
 
    def to_stdout(self, message, skip_eol=False, check_quiet=False):
        """Print message to stdout if not in quiet mode."""
 
        write_string(
            '[debug] Encodings: locale %s, fs %s, out %s, pref %s\n' % (
                locale.getpreferredencoding(),
                sys.getfilesystemencoding(),

src/k/a/ka-lite-HEAD/python-packages/youtube_dl/YoutubeDL.py   ka-lite(Download)
    import ctypes
 
from .utils import (
    compat_cookiejar,
    compat_http_client,
            output = message + terminator
 
            write_string(output, self._screen_file)
 
    def to_stderr(self, message):
            message = self._bidi_workaround(message)
            output = message + '\n'
            write_string(output, self._err_file)
 
    def to_console_title(self, message):
            ctypes.windll.kernel32.SetConsoleTitleW(ctypes.c_wchar_p(message))
        elif 'TERM' in os.environ:
            write_string('\033]0;%s\007' % message, self._screen_file)
 
    def save_console_title(self):
        if not self.params.get('consoletitle', False):
            return
        if 'TERM' in os.environ:
            # Save the title on stack
            write_string('\033[22;0t', self._screen_file)

src/k/a/ka-lite-HEAD/python-packages/youtube_dl/__init__.py   ka-lite(Download)
 
 
from .utils import (
    compat_print,
    DateRange,
        opts, args = parser.parse_args(overrideArguments)
        if opts.verbose:
            write_string(u'[debug] Override config: ' + repr(overrideArguments) + '\n')
    else:
        commandLineConf = sys.argv[1:]
        opts, args = parser.parse_args(argv)
        if opts.verbose:
            write_string(u'[debug] System config: ' + repr(_hide_login_info(systemConf)) + '\n')
            write_string(u'[debug] User config: ' + repr(_hide_login_info(userConf)) + '\n')
            write_string(u'[debug] Command-line args: ' + repr(_hide_login_info(commandLineConf)) + '\n')

src/y/o/youtube_dl-2014.04.30.1/youtube_dl/__init__.py   youtube_dl(Download)
 
 
from .utils import (
    compat_getpass,
    compat_print,
        opts, args = parser.parse_args(overrideArguments)
        if opts.verbose:
            write_string(u'[debug] Override config: ' + repr(overrideArguments) + '\n')
    else:
        commandLineConf = sys.argv[1:]
        opts, args = parser.parse_args(argv)
        if opts.verbose:
            write_string(u'[debug] System config: ' + repr(_hide_login_info(systemConf)) + '\n')
            write_string(u'[debug] User config: ' + repr(_hide_login_info(userConf)) + '\n')
            write_string(u'[debug] Command-line args: ' + repr(_hide_login_info(commandLineConf)) + '\n')

src/y/o/youtube-dl-HEAD/youtube_dl/__init__.py   youtube-dl(Download)
 
 
from .utils import (
    compat_getpass,
    compat_print,
        opts, args = parser.parse_args(overrideArguments)
        if opts.verbose:
            write_string(u'[debug] Override config: ' + repr(overrideArguments) + '\n')
    else:
        commandLineConf = sys.argv[1:]
        opts, args = parser.parse_args(argv)
        if opts.verbose:
            write_string(u'[debug] System config: ' + repr(_hide_login_info(systemConf)) + '\n')
            write_string(u'[debug] User config: ' + repr(_hide_login_info(userConf)) + '\n')
            write_string(u'[debug] Command-line args: ' + repr(_hide_login_info(commandLineConf)) + '\n')