当前位置: 首页>>代码示例>>Python>>正文


Python TypeConvert.dbus2py方法代码示例

本文整理汇总了Python中nmlib.nm_utils.TypeConvert.dbus2py方法的典型用法代码示例。如果您正苦于以下问题:Python TypeConvert.dbus2py方法的具体用法?Python TypeConvert.dbus2py怎么用?Python TypeConvert.dbus2py使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nmlib.nm_utils.TypeConvert的用法示例。


在下文中一共展示了TypeConvert.dbus2py方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: check_setting_finish

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
    def check_setting_finish(self):
        ###check if user complete his setting, avoid the missing property exception
        info_dict = TypeConvert.dbus2py(self.settings_dict)
        try:
            if info_dict["connection"]["type"] == "802-3-ethernet":
                return self.is_wired_setting_ok(info_dict)

            elif info_dict["connection"]["type"] == "802-11-wireless":
                return self.is_wireless_setting_ok(info_dict)

            elif info_dict["connection"]["type"] == "pppoe":
                return self.is_dsl_setting_ok(info_dict)

            elif info_dict["connection"]["type"] == "vpn":
                return self.is_vpn_setting_ok(info_dict)

            elif info_dict["connection"]["type"] == "cdma":
                return self.is_cdma_setting_ok(info_dict)

            elif info_dict["connection"]["type"] == "gsm":
                return self.is_gsm_setting_ok(info_dict)

            else:
                return False
        except:
            traceback.print_exc()
开发者ID:martyr-deepin,项目名称:deepin-system-settings,代码行数:28,代码来源:nmconnection.py

示例2: check_setting_commit

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
    def check_setting_commit(self):
        ###delete invalid setting property before update
        for key in self.settings_dict.keys():
            for key2 in self.settings_dict[key]:
                if self.settings_dict[key][key2] == None:
                    self.settings_dict[key][key2] = ""

        info_dict = TypeConvert.dbus2py(self.settings_dict)
        try:
            if info_dict["connection"]["type"] == "802-3-ethernet":
                if not self.get_setting("802-3-ethernet").wired_valid():
                    ###or raise exception
                    return False
                self.get_setting("ipv4").adapt_ip4config_commit()

                if "ipv6" in info_dict.iterkeys():
                    self.get_setting("ipv6").adapt_ip6config_commit()

            elif info_dict["connection"]["type"] == "802-11-wireless":
                self.get_setting("802-11-wireless").adapt_wireless_commit()

                if "802-11-wireless-security" in info_dict.iterkeys():
                    self.get_setting("802-11-wireles-security").adapt_wireless_security_commit()

                self.get_setting("ipv4").adapt_ip4config_commit()

                if "ipv6" in info_dict.iterkeys():
                    self.get_setting("ipv6").adapt_ip6config_commit()

            elif info_dict["connection"]["type"] == "pppoe":
                if not self.get_setting("802-3-ethernet").wired_valid():
                    return False
                self.get_setting("ipv4").adapt_ip4config_commit()

                if "ipv6" in info_dict.iterkeys():
                    self.get_setting("ipv6").adapt_ip6config_commit()

            elif info_dict["connection"]["type"] == "vpn":
                pass

            elif info_dict["connection"]["type"] == "cdma":
                pass

            elif info_dict["connection"]["type"] == "gsm":
                pass

            else:
                print "invalid connection_type"
        except:
            pass
开发者ID:martyr-deepin,项目名称:deepin-system-settings,代码行数:52,代码来源:nmconnection.py

示例3: read_only

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def read_only(self):
     if "read-only" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["read-only"])
     else:
         return False
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:7,代码来源:nmsetting_connection.py

示例4: id

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def id(self):
     if "id" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["id"])
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:5,代码来源:nmsetting_connection.py

示例5: zone

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def zone(self):
     if "zone" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["zone"])
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:5,代码来源:nmsetting_connection.py

示例6: timestamp

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def timestamp(self):
     if "timestamp" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["timestamp"])
     else:
         return  0
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:7,代码来源:nmsetting_connection.py

示例7: user_name

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def user_name(self):
     if "user-name" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["user-name"])
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:5,代码来源:nmsetting_vpn.py

示例8: refuse_mschapv2

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def refuse_mschapv2(self):
     if "refuse-mschapv2" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["refuse-mschapv2"])
     else:
         return False
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:7,代码来源:nmsetting_ppp.py

示例9: nodeflate

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def nodeflate(self):
     if "nodeflate" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["nodeflate"])
     else:
         return False
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:7,代码来源:nmsetting_ppp.py

示例10: send_delay

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def send_delay(self):
     if "send-delay" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["send-delay"])
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:5,代码来源:nmsetting_serial.py

示例11: stopbits

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def stopbits(self):
     if "stopbits" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["stopbits"])
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:5,代码来源:nmsetting_serial.py

示例12: parity

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def parity(self):
     if "parity" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["parity"])
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:5,代码来源:nmsetting_serial.py

示例13: enumerate_devices

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def enumerate_devices(self):
     return TypeConvert.dbus2py(self.dbus_method("EnumerateDevices"))
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:4,代码来源:mmclient.py

示例14: hidden

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def hidden(self):
     if "hidden" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["hidden"])
     else:
         return False
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:7,代码来源:nmsetting_wireless.py

示例15: channel

# 需要导入模块: from nmlib.nm_utils import TypeConvert [as 别名]
# 或者: from nmlib.nm_utils.TypeConvert import dbus2py [as 别名]
 def channel(self):
     if "channel" in self.prop_dict.iterkeys():
         return TypeConvert.dbus2py(self.prop_dict["channel"])
     else:
         return 0
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:7,代码来源:nmsetting_wireless.py


注:本文中的nmlib.nm_utils.TypeConvert.dbus2py方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。