Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def upload_packages():
    config = BibOSConfig()
    data = config.get_data()

    admin_url = data['admin_url']
    xml_rpc_url = data.get('xml_rpc_url', '/admin-xml/')
    uid = data['uid']

    admin = BibOSAdmin(urlparse.urljoin(admin_url, xml_rpc_url))

    # TODO: Make option to turn off/avoid repeating this.
    os.system('get_package_data /tmp/packages.csv')

    upgrade_pkgs = set(get_upgrade_packages())

    with open('/tmp/packages.csv') as f:
        package_reader = csv.reader(f, delimiter=';')
        package_data = [
            {
                'name': n,
                'status': 'needs upgrade' if n in upgrade_pkgs else s,
                'version': v,
                'description': d
            } for (n, s, v, d) in package_reader
        ]

    try:
        admin.send_status_info(uid, package_data, None)
    except Exception as e:
        print >> sys.stderr, 'Error:', str(e)
        sys.exit(1)
        


src/b/i/bibos_admin-HEAD/bibos_client/bibos_client/jobmanager.py   bibos_admin(Download)
 
from admin_client import BibOSAdmin
from utils import upload_packages, filelock
 
"""
        try:
            # Send full package info to server.
            upload_packages()
        except Exception as e:
            print >>os.sys.stderr, "Package upload failed" + str(e)

src/b/i/bibos_client-0.0.2.5/bibos_client/jobmanager.py   bibos_client(Download)
 
from admin_client import BibOSAdmin
from utils import upload_packages, filelock
 
"""
        try:
            # Send full package info to server.
            upload_packages()
        except Exception as e:
            print >>os.sys.stderr, "Package upload failed" + str(e)