Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(0)  |  Derive(0)  |  Import(10)
dict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object's
    (key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
    d = {}
    for k, v in iterable:
        d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
    in the keyword argument list.  For example:  dict(one=1, two=2)

src/k/a/karesansui-HEAD/karesansui/lib/virt/virt.py   karesansui(Download)
import karesansui.lib.locale
 
from karesansui.lib.const import VIRT_LIBVIRT_DATA_DIR, VIRT_DOMAINS_DIR, \
     VIRT_XML_CONFIG_DIR, VIRT_NETWORK_CONFIG_DIR, VIRT_SNAPSHOT_DIR, \
     VIRT_XENDOMAINS_AUTO_DIR, VIRT_AUTOSTART_CONFIG_DIR, \
 
        import shutil
        if use == DISK_USES["IMAGES"]:
            disk = "%s/%s/%s.img" % (domain_dir, DISK_USES["IMAGES"], name)
            shutil.move("%s/%s" % (domains_dir, param.get_storage_name()),
                       "%s/%s" % (domains_dir, param.get_storage_name()))
        else:
            disk = "%s/%s/%s.img" % (domain_dir, DISK_USES["DISK"], uuid)
            shutil.move("%s/%s" % (domains_dir, uuid),
                        disk)
 
        # physical process
        if use == DISK_USES["IMAGES"]:
            os.remove(taget_real_path)
            if os.path.exists(target_path) is True:

src/k/a/karesansui-HEAD/karesansui/gadget/guest.py   karesansui(Download)
    CHECK_MIN, CHECK_MAX, CHECK_EXIST
 
from karesansui.lib.const import \
    NOTE_TITLE_MIN_LENGTH, NOTE_TITLE_MAX_LENGTH, \
    MACHINE_NAME_MIN_LENGTH, MACHINE_NAME_MAX_LENGTH, \
    options['permission_group'] = pwd.getpwnam(STORAGE_VOLUME_PWD["GROUP"])[2]
    options['permission_mode'] = STORAGE_VOLUME_PWD["MODE"]
    options['use'] = DISK_USES["IMAGES"]
 
    _cmd = dict2command(
    rollback_options["name"] = uuid
    rollback_options["pool_name"] = pool_name
    rollback_options["use"] = DISK_USES["IMAGES"]
 
    rollback_cmd = dict2command(

src/k/a/karesansui-HEAD/karesansui/gadget/guestreplicate.py   karesansui(Download)
    CHECK_MIN, CHECK_MAX
 
from karesansui.lib.const import \
    NOTE_TITLE_MIN_LENGTH, NOTE_TITLE_MAX_LENGTH, \
    MACHINE_NAME_MIN_LENGTH, MACHINE_NAME_MAX_LENGTH, \
    rollback_options["name"] = dest_volume
    rollback_options["pool_name"] = dest_pool
    rollback_options["use"] = DISK_USES["DISK"]
 
    rollback_cmd = dict2command(

src/k/a/karesansui-HEAD/karesansui/gadget/guestby1.py   karesansui(Download)
    CHECK_EMPTY, CHECK_LENGTH, CHECK_ONLYSPACE
 
from karesansui.lib.const import \
    NOTE_TITLE_MIN_LENGTH, NOTE_TITLE_MAX_LENGTH, \
    MACHINE_NAME_MIN_LENGTH, MACHINE_NAME_MAX_LENGTH, \
                            volume = key # disk image
 
                    use = DISK_USES['DISK']
                    if volume is None: # os image
                        os_volume = self.kvc.get_storage_volume_bydomain(domname, 'os', 'key')
                        if not os_volume:
                            return web.badrequest(_("OS storage volume for guest could not be found. domname=%s") % domname)
 
                        if disk['source']['file'] == os.path.realpath(os_volume.values()[0]):
                            use = DISK_USES['IMAGES']

src/k/a/karesansui-HEAD/karesansui/gadget/guestby1disk.py   karesansui(Download)
 
import karesansui
from karesansui.lib.const import VIRT_COMMAND_ADD_DISK, DISK_MIN_SIZE, \
     STORAGE_VOLUME_PWD, DISK_USES, \
     VIRT_COMMAND_DELETE_STORAGE_VOLUME, VIRT_COMMAND_CREATE_STORAGE_VOLUME
    options['permission_group'] = pwd.getpwnam(STORAGE_VOLUME_PWD["GROUP"])[2]
    options['permission_mode'] = STORAGE_VOLUME_PWD["MODE"]
    options['use'] = DISK_USES["DISK"]
    options['volume'] = volume_name
 
    rollback_options["name"] = domname
    rollback_options["pool_name"] = pool_name
    rollback_options["use"] = DISK_USES["IMAGES"]
 
    rollback_cmd = dict2command(

src/k/a/karesansui-HEAD/bin/create_storage_volume.py   karesansui(Download)
    from karesansui.lib.virt.virt import KaresansuiVirtConnection
    from karesansui.lib.utils import load_locale, get_pwd_info, get_grp_info
    from karesansui.lib.const import STORAGE_POOL_TYPE, STORAGE_VOLUME_FORMAT, \
        STORAGE_VOLUME_SIZE_MIN_LENGTH, STORAGE_VOLUME_SIZE_MAX_LENGTH, STORAGE_VOLUME_UNIT, \
        DISK_USES
                                         'images or disk is available. use=%s' % opts.use)
 
        if opts.use == DISK_USES["IMAGES"]:
            if not opts.volume_name:
                raise KssCommandOptException('ERROR: %s option is required.' % '-v or --volume_name')

src/k/a/karesansui-HEAD/karesansui/gadget/guestby1device.py   karesansui(Download)
from pysilhouette.command import dict2command
 
from karesansui.lib.const import DISK_QEMU_FORMAT, DISK_NON_QEMU_FORMAT, \
     STORAGE_VOLUME_PWD, DISK_USES, \
     VIRT_COMMAND_DELETE_STORAGE_VOLUME, VIRT_COMMAND_CREATE_STORAGE_VOLUME

src/k/a/karesansui-HEAD/karesansui/gadget/guestby1diskby1.py   karesansui(Download)
from karesansui.lib.rest import Rest, auth
 
from karesansui.lib.const import VIRT_COMMAND_DELETE_DISK, \
     DISK_USES, VIRT_COMMAND_DELETE_STORAGE_VOLUME
from karesansui.lib.virt.virt import KaresansuiVirtException, \
                                                   pool_name,
                                                   order,
                                                   use=DISK_USES["DISK"]
                                                   )
                order += 1

src/k/a/karesansui-HEAD/bin/add_disk.py   karesansui(Download)
    from karesansui.lib.virt.virt import KaresansuiVirtConnection
    from karesansui.lib.utils import load_locale, get_disk_img_info
    from karesansui.lib.const import ISCSI_DEVICE_DIR, DISK_USES
 
except ImportError, e:
                                   (conn.get_storage_pool_targetpath(opts.pool),
                                    opts.name,
                                    DISK_USES["DISK"],
                                    opts.volume)
                format = opts.format

src/k/a/karesansui-HEAD/bin/delete_storage_volume.py   karesansui(Download)
    from karesansui.lib.virt.virt import KaresansuiVirtConnection
    from karesansui.lib.utils import load_locale
    from karesansui.lib.const import DISK_USES
 
except ImportError, e: