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

All Samples(4)  |  Call(0)  |  Derive(0)  |  Import(4)
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/gadget/hostby1storagepool.py   karesansui(Download)
from karesansui.lib.rest import Rest, auth
from karesansui.lib.virt.virt import KaresansuiVirtConnection
from karesansui.lib.const import STORAGE_POOL_TYPE, \
     VIRT_COMMAND_CREATE_STORAGE_POOL, STORAGE_VOLUME_FORMAT, \
     VIRT_COMMAND_DELETE_STORAGE_POOL, STORAGE_POOL_PWD, \
 
    automount_options = {}
    automount_options["type"] = STORAGE_POOL_TYPE['TYPE_FS']
 
    for disk in automount_list:
 
            self.view.network_storages = available_network_storages
            self.view.pool_types = (STORAGE_POOL_TYPE["TYPE_DIR"],
                                    STORAGE_POOL_TYPE["TYPE_ISCSI"])
 
 
        now_pools = inactive_pool + active_pool
        if self.input.pool_type == STORAGE_POOL_TYPE["TYPE_DIR"]:
            if not validates_pool_dir(self, now_pools):
                return web.badrequest(self.view.alert)

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

src/k/a/karesansui-HEAD/bin/create_storage_pool.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
 
except ImportError, e:
        raise KssCommandOptException('ERROR: %s option is required.' % '-t or --type')
 
    if opts.type == STORAGE_POOL_TYPE["TYPE_DIR"]:
        # type:dir
        if not opts.target_path:
            raise KssCommandOptException('ERROR: %s option is required.' % '-p or --target_path')
 
    elif opts.type == STORAGE_POOL_TYPE["TYPE_ISCSI"]:
            raise KssCommandOptException('ERROR: %s option is required.' % '-d or --device_path')
 
    elif opts.type == STORAGE_POOL_TYPE["TYPE_FS"]:
        # type:fs
        if not opts.target_path:
 
            try:
                if opts.type == STORAGE_POOL_TYPE["TYPE_DIR"]:
                    if conn.create_storage_pool(opts.name, opts.type,
                                                opts.target_path,

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