()
Run when this module is called from the command line.
Run when this module is called from the command line.
Run when this module is called from the command line .
def isbg_sa_unwrap():
    """Run when this module is called from the command line."""
    try:
        opts = docopt(__isbg_sa_unwrap_opts__.__doc__,
                      version="isbg_sa_unwrap v" + isbg.__version__ +
                      ", from: " + os.path.abspath(__file__) + "\n\n" +
                      isbg.__license__)
    except DocoptExit:
        sys.stderr.write('Error with options!!!\n')
        raise

    if opts.get("--usage"):
        sys.stdout.write(
            "{}\n".format(printable_usage(__isbg_sa_unwrap_opts__.__doc__)))
        return

    if opts.get("--from"):
        file_in = open(opts["--from"], 'rb')
    else:
        file_in = sys.stdin

    if hasattr(file_in, 'buffer'):
        file_in = file_in.buffer    # pylint: disable=no-member

    spams = unwrap(file_in.read())
    file_in.close()

    if spams is None:
        sys.stderr.write("No spam into the mail detected.\n")
        return

    if opts.get("--to"):
        file_out = open(opts["--to"], 'wb')
    else:
        file_out = sys.stdout

    for spam in spams:
        file_out.write(spam.as_string())

    if file_out != sys.stdout:
        file_out.close()
def isbg_sa_unwrap ( ) : try : opts = docopt ( __isbg_sa_unwrap_opts__ . __doc__ , version = "isbg_sa_unwrap v" + isbg . __version__ + ", from: " + os . path . abspath ( __file__ ) + "\n\n" + isbg . __license__ ) except DocoptExit : sys . stderr . write ( 'Error with options!!!\n' ) raise if opts . get ( "--usage" ) : sys . stdout . write ( "{}\n" . format ( printable_usage ( __isbg_sa_unwrap_opts__ . __doc__ ) ) ) return if opts . get ( "--from" ) : file_in = open ( opts [ "--from" ] , 'rb' ) else : file_in = sys . stdin if hasattr ( file_in , 'buffer' ) : file_in = file_in . buffer # pylint: disable=no-member spams = unwrap ( file_in . read ( ) ) file_in . close ( ) if spams is None : sys . stderr . write ( "No spam into the mail detected.\n" ) return if opts . get ( "--to" ) : file_out = open ( opts [ "--to" ] , 'wb' ) else : file_out = sys . stdout for spam in spams : file_out . write ( spam . as_string ( ) ) if file_out != sys . stdout : file_out . close ( )