VirtualMailManager/cli/__init__.py
branchv0.7.x
changeset 653 cf07e4468934
parent 643 df1e3b67882a
child 654 f2463a64e1d7
equal deleted inserted replaced
652:68d715ce6e1c 653:cf07e4468934
    29 
    29 
    30 def w_std(*args):
    30 def w_std(*args):
    31     """Writes a line for each arg of *args*, encoded in the current
    31     """Writes a line for each arg of *args*, encoded in the current
    32     ENCODING, to stdout.
    32     ENCODING, to stdout.
    33     """
    33     """
    34     _std_write('\n'.join(a.encode(ENCODING, 'replace') for a in args) + '\n')
    34     _std_write('\n'.join(arg.encode(ENCODING, 'replace').decode()
       
    35                for arg in args) + '\n')
    35 
    36 
    36 
    37 
    37 def w_err(code, *args):
    38 def w_err(code, *args):
    38     """Writes a line for each arg of *args*, encoded in the current
    39     """Writes a line for each arg of *args*, encoded in the current
    39     ENCODING, to stderr.
    40     ENCODING, to stderr.
    40     This function optionally interrupts the program execution if *code*
    41     This function optionally interrupts the program execution if *code*
    41     does not equal to 0. *code* will be used as the system exit status.
    42     does not equal to 0. *code* will be used as the system exit status.
    42     """
    43     """
    43     _err_write('\n'.join(a.encode(ENCODING, 'replace') for a in args) + '\n')
    44     _err_write('\n'.join(arg.encode(ENCODING, 'replace').decode()
       
    45                for arg in args) + '\n')
    44     if code:
    46     if code:
    45         os.sys.exit(code)
    47         os.sys.exit(code)
    46 
    48 
    47 
    49 
    48 def get_winsize():
    50 def get_winsize():