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


Python StoreDict.keys方法代码示例

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


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

示例1: __init__

# 需要导入模块: from electrum.util import StoreDict [as 别名]
# 或者: from electrum.util.StoreDict import keys [as 别名]

#.........这里部分代码省略.........
            out = self.run_popup("", ["blah", "foo"])

    def edit_str(self, target, c, is_num=False):
        # detect backspace
        if c in [8, 127, 263] and target:
            target = target[:-1]
        elif not is_num or curses.unctrl(c) in "0123456789.":
            target += curses.unctrl(c)
        return target

    def run_send_tab(self, c):
        if self.pos % 6 == 0:
            self.str_recipient = self.edit_str(self.str_recipient, c)
        if self.pos % 6 == 1:
            self.str_description = self.edit_str(self.str_description, c)
        if self.pos % 6 == 2:
            self.str_amount = self.edit_str(self.str_amount, c, True)
        elif self.pos % 6 == 3:
            self.str_fee = self.edit_str(self.str_fee, c, True)
        elif self.pos % 6 == 4:
            if c == 10:
                self.do_send()
        elif self.pos % 6 == 5:
            if c == 10:
                self.do_clear()

    def run_receive_tab(self, c):
        if c == 10:
            out = self.run_popup("Address", ["Edit label", "Freeze", "Prioritize"])

    def run_contacts_tab(self, c):
        if c == 10 and self.contacts:
            out = self.run_popup("Adress", ["Copy", "Pay to", "Edit label", "Delete"]).get("button")
            key = self.contacts.keys()[self.pos % len(self.contacts.keys())]
            if out == "Pay to":
                self.tab = 1
                self.str_recipient = key
                self.pos = 2
            elif out == "Edit label":
                s = self.get_string(6 + self.pos, 18)
                if s:
                    self.wallet.labels[address] = s

    def run_banner_tab(self, c):
        self.show_message(repr(c))
        pass

    def main(self):

        tty.setraw(sys.stdin)
        while self.tab != -1:
            self.run_tab(0, self.print_history, self.run_history_tab)
            self.run_tab(1, self.print_send_tab, self.run_send_tab)
            self.run_tab(2, self.print_receive, self.run_receive_tab)
            self.run_tab(3, self.print_contacts, self.run_contacts_tab)
            self.run_tab(4, self.print_banner, self.run_banner_tab)

        tty.setcbreak(sys.stdin)
        curses.nocbreak()
        self.stdscr.keypad(0)
        curses.echo()
        curses.endwin()

    def do_clear(self):
        self.str_amount = ""
        self.str_recipient = ""
开发者ID:keepkey,项目名称:electrum,代码行数:70,代码来源:text.py

示例2: __init__

# 需要导入模块: from electrum.util import StoreDict [as 别名]
# 或者: from electrum.util.StoreDict import keys [as 别名]

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


    def edit_str(self, target, c, is_num=False):
        # detect backspace
        if c in [8, 127, 263] and target:
            target = target[:-1]
        elif not is_num or curses.unctrl(c) in '0123456789.':
            target += curses.unctrl(c)
        return target


    def run_send_tab(self, c):
        if self.pos%6 == 0:
            self.str_recipient = self.edit_str(self.str_recipient, c)
        if self.pos%6 == 1:
            self.str_description = self.edit_str(self.str_description, c)
        if self.pos%6 == 2:
            self.str_amount = self.edit_str(self.str_amount, c, True)
        elif self.pos%6 == 3:
            self.str_fee = self.edit_str(self.str_fee, c, True)
        elif self.pos%6==4:
            if c == 10: self.do_send()
        elif self.pos%6==5:
            if c == 10: self.do_clear()


    def run_receive_tab(self, c):
        if c == 10:
            out = self.run_popup('Address', ["Edit label", "Freeze", "Prioritize"])

    def run_contacts_tab(self, c):
        if c == 10 and self.contacts:
            out = self.run_popup('Adress', ["Copy", "Pay to", "Edit label", "Delete"]).get('button')
            key = self.contacts.keys()[self.pos%len(self.contacts.keys())]
            if out == "Pay to":
                self.tab = 1
                self.str_recipient = key
                self.pos = 2
            elif out == "Edit label":
                s = self.get_string(6 + self.pos, 18)
                if s:
                    self.wallet.labels[address] = s

    def run_banner_tab(self, c):
        self.show_message(repr(c))
        pass

    def main(self):

        tty.setraw(sys.stdin)
        while self.tab != -1:
            self.run_tab(0, self.print_history, self.run_history_tab)
            self.run_tab(1, self.print_send_tab, self.run_send_tab)
            self.run_tab(2, self.print_receive, self.run_receive_tab)
            self.run_tab(3, self.print_addresses, self.run_banner_tab)
            self.run_tab(4, self.print_contacts, self.run_contacts_tab)
            self.run_tab(5, self.print_banner, self.run_banner_tab)

        tty.setcbreak(sys.stdin)
        curses.nocbreak()
        self.stdscr.keypad(0)
        curses.echo()
        curses.endwin()


    def do_clear(self):
开发者ID:cryptapus,项目名称:electrum-myr,代码行数:70,代码来源:text.py


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