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


Python PasswordDialog.init方法代码示例

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


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

示例1: ElectrumWindow

# 需要导入模块: from uix.dialogs.password_dialog import PasswordDialog [as 别名]
# 或者: from uix.dialogs.password_dialog.PasswordDialog import init [as 别名]

#.........这里部分代码省略.........

    def _get_orientation(self):
        return self._orientation

    orientation = AliasProperty(_get_orientation,
                                None,
                                bind=('_orientation',))
    '''Tries to ascertain the kind of device the app is running on.
    Cane be one of `tablet` or `phone`.

    :data:`orientation` is a read only `AliasProperty` Defaults to 'landscape'
    '''

    _ui_mode = OptionProperty('phone', options=('tablet', 'phone'))

    def _get_ui_mode(self):
        return self._ui_mode

    ui_mode = AliasProperty(_get_ui_mode,
                            None,
                            bind=('_ui_mode',))
    '''Defines tries to ascertain the kind of device the app is running on.
    Cane be one of `tablet` or `phone`.

    :data:`ui_mode` is a read only `AliasProperty` Defaults to 'phone'
    '''

    wallet = ObjectProperty(None)
    '''Holds the electrum wallet

    :attr:`wallet` is a `ObjectProperty` defaults to None.
    '''

    def __init__(self, **kwargs):
        # initialize variables
        self._clipboard = Clipboard
        self.info_bubble = None
        self.qrscanner = None
        self.nfcscanner = None
        self.tabs = None
        self.is_exit = False

        super(ElectrumWindow, self).__init__(**kwargs)

        title = _('Electrum App')
        self.electrum_config = config = kwargs.get('config', None)
        self.language = config.get('language', 'en')
        self.network = network = kwargs.get('network', None)
        self.plugins = kwargs.get('plugins', [])

        self.gui_object = kwargs.get('gui_object', None)

        #self.config = self.gui_object.config
        self.contacts = Contacts(self.electrum_config)
        self.invoices = InvoiceStore(self.electrum_config)

        # create triggers so as to minimize updation a max of 2 times a sec
        self._trigger_update_wallet =\
            Clock.create_trigger(self.update_wallet, .5)
        self._trigger_update_status =\
            Clock.create_trigger(self.update_status, .5)
        self._trigger_notify_transactions = \
            Clock.create_trigger(self.notify_transactions, 5)
        # cached dialogs
        self._settings_dialog = None
        self._password_dialog = None
开发者ID:gerrit-rws,项目名称:electrum,代码行数:70,代码来源:main_window.py

示例2: ElectrumWindow

# 需要导入模块: from uix.dialogs.password_dialog import PasswordDialog [as 别名]
# 或者: from uix.dialogs.password_dialog.PasswordDialog import init [as 别名]

#.........这里部分代码省略.........
        a, u = amount_str.split()
        assert u == self.base_unit
        try:
            x = Decimal(a)
        except:
            return None
        p = pow(10, self.decimal_point())
        return int(p * x)

    _orientation = OptionProperty("landscape", options=("landscape", "portrait"))

    def _get_orientation(self):
        return self._orientation

    orientation = AliasProperty(_get_orientation, None, bind=("_orientation",))
    """Tries to ascertain the kind of device the app is running on.
    Cane be one of `tablet` or `phone`.

    :data:`orientation` is a read only `AliasProperty` Defaults to 'landscape'
    """

    _ui_mode = OptionProperty("phone", options=("tablet", "phone"))

    def _get_ui_mode(self):
        return self._ui_mode

    ui_mode = AliasProperty(_get_ui_mode, None, bind=("_ui_mode",))
    """Defines tries to ascertain the kind of device the app is running on.
    Cane be one of `tablet` or `phone`.

    :data:`ui_mode` is a read only `AliasProperty` Defaults to 'phone'
    """

    def __init__(self, **kwargs):
        # initialize variables
        self._clipboard = Clipboard
        self.info_bubble = None
        self.nfcscanner = None
        self.tabs = None
        self.is_exit = False
        self.wallet = None

        super(ElectrumWindow, self).__init__(**kwargs)

        title = _("Electrum App")
        self.electrum_config = config = kwargs.get("config", None)
        self.language = config.get("language", "en")
        self.network = network = kwargs.get("network", None)
        self.plugins = kwargs.get("plugins", [])

        self.gui_object = kwargs.get("gui_object", None)
        self.daemon = self.gui_object.daemon

        self.contacts = Contacts(self.electrum_config)
        self.invoices = InvoiceStore(self.electrum_config)

        # create triggers so as to minimize updation a max of 2 times a sec
        self._trigger_update_wallet = Clock.create_trigger(self.update_wallet, 0.5)
        self._trigger_update_status = Clock.create_trigger(self.update_status, 0.5)
        # cached dialogs
        self._settings_dialog = None
        self._password_dialog = None

    def wallet_name(self):
        return os.path.basename(self.wallet.storage.path) if self.wallet else " "
开发者ID:ywzqhl,项目名称:electrum,代码行数:69,代码来源:main_window.py


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