def send(recpt_box_id, uname, pwd, subj, attachements):
    """
    attachements: list of tuples of (mime, description, content)
    """
    ds_client = None
    try:
        # create the client
        ds_client = Client(login_method='username',
                           login=uname,
                           password=pwd,
                           test_environment=False)

        return _create_message(ds_client, recpt_box_id, subj, attachements)
    finally:
        if ds_client:
            ds_client.logout_from_server()
示例#2
0
def send(recpt_box_id, uname, pwd, subj, attachements):
    """
    attachements: list of tuples of (mime, description, content)
    """
    ds_client = None
    try:
        # create the client
        ds_client = Client(login_method='username',
                           login=uname,
                           password=pwd,
                           test_environment=False)

        return _create_message(ds_client, recpt_box_id, subj, attachements)
    finally:
        if ds_client:
            ds_client.logout_from_server()
示例#3
0
    parser.add_option('-u', '--username', action='store', dest='uname',
                      help='uzivatelske jmeno k tvoji DS',)
    parser.add_option('-p', '--pwd', action='store', dest='pwd',
                      help='heslo k tvoji DS',)

    (options, args) = parser.parse_args()

    if len(args) != 1:
        parser.error('wrong number of arguments')

    logging.basicConfig(level=logging.INFO)
    logging.getLogger('suds').setLevel(logging.ERROR)

    query = args[0].decode('utf-8')
    
    logging.info("searching for %s ..." % query) 

    try:
        # create the client
        ds_client = Client(login_method='username',
                           login=options.uname,
                           password=options.pwd,
                           test_environment=False)

        create_message(ds_client, query)
    except Exception, e:
        logging.error(str(e))
    finally:
        ds_client.logout_from_server()
示例#4
0
        '--pwd',
        action='store',
        dest='pwd',
        help='heslo k tvoji DS',
    )

    (options, args) = parser.parse_args()

    if len(args) != 1:
        parser.error('wrong number of arguments')

    logging.basicConfig(level=logging.INFO)
    logging.getLogger('suds').setLevel(logging.ERROR)

    query = args[0].decode('utf-8')

    logging.info("searching for %s ..." % query)

    try:
        # create the client
        ds_client = Client(login_method='username',
                           login=options.uname,
                           password=options.pwd,
                           test_environment=False)

        create_message(ds_client, query)
    except Exception, e:
        logging.error(str(e))
    finally:
        ds_client.logout_from_server()