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


Python ui.Ui类代码示例

本文整理汇总了Python中ui.Ui的典型用法代码示例。如果您正苦于以下问题:Python Ui类的具体用法?Python Ui怎么用?Python Ui使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: __init__

 def __init__(self):
     reload(sys)
     sys.setdefaultencoding("UTF-8")
     self.config = Config()
     self.datatype = "main"
     self.title = "网易云音乐"
     self.datalist = ["排行榜", "艺术家", "新碟上架", "精选歌单", "我的歌单", "DJ节目", "每日推荐", "私人FM", "搜索", "帮助"]
     self.offset = 0
     self.index = 0
     self.storage = Storage()
     self.storage.load()
     self.collection = self.storage.database["collections"][0]
     self.player = Player()
     self.player.playing_song_changed_callback = self.song_changed_callback
     self.cache = Cache()
     self.ui = Ui()
     self.netease = NetEase()
     self.screen = curses.initscr()
     self.screen.keypad(1)
     self.step = 10
     self.stack = []
     self.djstack = []
     self.userid = self.storage.database["user"]["user_id"]
     self.username = self.storage.database["user"]["nickname"]
     self.resume_play = True
     self.at_playing_list = False
     signal.signal(signal.SIGWINCH, self.change_term)
     signal.signal(signal.SIGINT, self.send_kill)
     self.START = time.time()
开发者ID:RockHong,项目名称:netease-music-cli-player,代码行数:29,代码来源:menu.py

示例2: effect

    def effect(self):
        """If there is an original element, store it. Open the GUI."""

        self.orig, self.orig_src = self.get_original()

        self.ui = Ui(self.render, self.orig_src, self.get_settings())
        self.ui.main()
开发者ID:janoliver,项目名称:inktex,代码行数:7,代码来源:inktex_cls.py

示例3: __init__

    def __init__(self):
        reload(sys)
        sys.setdefaultencoding('UTF-8')
        self.data_type = 'main'
        # Title of the application
        self.title = '网易云音乐'
        # Main-menu list
        self.data_list = ['排行榜', '艺术家', '新碟上架', '精选歌单', '我的歌单', 'DJ节目', '打碟', '收藏', '搜索', '帮助']
        # Which page of the data_list is displayed (data_list may be displayed in multiple pages
        self.page_index = 0
        # The index of the current selected line
        self.current_line_index = 0
        self.present_songs = []
        self.player = Player()
        self.ui = Ui()
        self.netease = NetEase()
        self.screen = curses.initscr()
        self.screen.keypad(1)
        self.page_size = 10  # The number of lines that can be displayed on one page.
        self.stack = []
        self.dj_stack = []
        self.user_id = None
        self.user_name = None

        # Read in the collection and account in flavor.json
        try:
            config_file = file(Constant.conf_dir + "/flavor.json", 'r')
            data = json.loads(config_file.read())
            self.collection = data['collection']
            self.account = data['account']
            config_file.close()
        except:
            self.collection = []
            self.account = {}
开发者ID:manfred-exz,项目名称:musicbox,代码行数:34,代码来源:menu.py

示例4: __init__

 def __init__(self):
     reload(sys)
     sys.setdefaultencoding('UTF-8')
     self.config = Config()
     self.datatype = 'main'
     self.title = 'NetEase Music'
     self.datalist = ['Charts', 'Artists', 'New Songs', 'Songs', 'My Songs', 'Radio Stations', 'Recommended',
                      'Personal Radio', 'Search', 'Help']
     self.offset = 0
     self.index = 0
     self.storage = Storage()
     self.storage.load()
     self.collection = self.storage.database['collections'][0]
     self.player = Player()
     self.player.playing_song_changed_callback = self.song_changed_callback
     self.cache = Cache()
     self.ui = Ui()
     self.netease = NetEase()
     self.screen = curses.initscr()
     self.screen.keypad(1)
     self.step = 10
     self.stack = []
     self.djstack = []
     self.userid = self.storage.database['user']['user_id']
     self.username = self.storage.database['user']['nickname']
     self.resume_play = True
     self.at_playing_list = False
     signal.signal(signal.SIGWINCH, self.change_term)
     signal.signal(signal.SIGINT, self.send_kill)
     self.START = time.time()
开发者ID:Zorgodon,项目名称:musicbox,代码行数:30,代码来源:menu.py

示例5: __init__

    def __init__(self):
        reload(sys)
        sys.setdefaultencoding('UTF-8')
        self.datatype = 'main'
        self.title = '网易云音乐'
        self.datalist = ['排行榜', '艺术家', '新碟上架', '精选歌单', '我的歌单', 'DJ节目', '打碟', '收藏', '搜索', '帮助']
        self.offset = 0
        self.index = 0
        self.presentsongs = []
        self.player = Player()
        self.ui = Ui()
        self.netease = NetEase()
        self.screen = curses.initscr()
        self.screen.keypad(1)
        self.step = 10
        self.stack = []
        self.djstack = []
        self.userid = None
        self.username = None
        self.resume_play = True
        signal.signal(signal.SIGWINCH, self.change_term)
        signal.signal(signal.SIGINT, self.send_kill)

        try:
            sfile = file(Constant.conf_dir + "/flavor.json", 'r')
            data = json.loads(sfile.read())
            self.collection = data['collection']
            self.account = data['account']
            self.presentsongs = data['presentsongs']
            sfile.close()
        except:
            self.collection = []
            self.account = {}
            self.presentsongs = []
            self.resume_play = False
开发者ID:GarfieldLinux,项目名称:musicbox,代码行数:35,代码来源:menu.py

示例6: __init__

 def __init__(self):
     reload(sys)
     sys.setdefaultencoding("UTF-8")
     self.datatype = "main"
     self.title = "网易云音乐"
     self.datalist = ["排行榜", "艺术家", "新碟上架", "精选歌单", "我的歌单", "DJ节目", "打碟", "收藏", "搜索", "帮助"]
     self.offset = 0
     self.index = 0
     self.storage = Storage()
     self.storage.load()
     self.collection = self.storage.database["collections"][0]
     self.player = Player()
     self.ui = Ui()
     self.netease = NetEase()
     self.screen = curses.initscr()
     self.screen.keypad(1)
     self.step = 10
     self.stack = []
     self.djstack = []
     self.userid = None
     self.username = None
     self.resume_play = True
     signal.signal(signal.SIGWINCH, self.change_term)
     signal.signal(signal.SIGINT, self.send_kill)
     self.START = time.time()
开发者ID:garfieldjty,项目名称:musicbox,代码行数:25,代码来源:menu.py

示例7: __init__

 def __init__(self):
     reload(sys)
     sys.setdefaultencoding('UTF-8')
     self.datatype = 'main'
     self.title = '网易云音乐'
     self.datalist = ['排行榜', '艺术家', '新碟上架', '精选歌单', '我的歌单', 'DJ节目', '打碟', '收藏', '搜索', '帮助']
     self.offset = 0
     self.index = 0
     self.presentsongs = []
     self.player = Player()
     self.ui = Ui()
     self.netease = NetEase()
     self.screen = curses.initscr()
     self.screen.keypad(1)
     self.step = STEP
     self.stack = []
     self.djstack = []
     self.userid = None
     self.username = None
     try:
         sfile = file(home + "/netease-musicbox/flavor.json",'r')
         data = json.loads(sfile.read())
         self.collection = data['collection']
         self.account = data['account']
         sfile.close()
     except:
         self.collection = []        
         self.account = {}
开发者ID:josephok,项目名称:NetEase-MusicBox,代码行数:28,代码来源:menu.py

示例8: __init__

 def __init__(self):
     self.ui = Ui()
     self.datatype = 'songs'
     self.popen_handler = None
     # flag stop, prevent thread start
     self.playing_flag = False
     self.pause_flag = False
     self.songs = []
     self.idx = 0
开发者ID:blindFS,项目名称:NetEase-MusicBox,代码行数:9,代码来源:player.py

示例9: Menu

class Menu():
	def __init__(self):
		reload(sys)
		sys.setdefaultencoding('utf8')
		self.const = util.Constant()
		self.datalist = ['搜索歌曲', '搜索艺术家']
		self.datatype = 'main'
		self.lib = Library()
		self.offset = 0
		self.page = 0
		self.player = vlc.VLC()
		self.START = time.time()
		self.step = 10
		self.title = 'KANraoke'
		self.screen = curses.initscr()
		self.ui = Ui()
		signal.signal(signal.SIGWINCH, self.change_term)
		signal.signal(signal.SIGINT, self.send_kill)

	def change_term(self, signum, frame):
		self.screen.clear()
		self.screen.refresh()

	def send_kill(self, signum, fram):
		curses.endwin()
		sys.exit()

	def start(self):
		self.ui.display_list(self.datatype, self.title, self.datalist, self.offset, self.page, self.step, self.START)
		while True:
			self.screen.timeout(500)
			key = self.screen.getch()
			# key = self.screen.getkey()
			# if key != -1:
			# 	print key
			self.screen.refresh()

			# break
			# if key == -1:
				# self.ui.update_size()
			self.ui.display_list(self.datatype, self.title, self.datalist, self.offset, self.page, self.step, self.START)
		pass
开发者ID:herooutman,项目名称:Kanraoke,代码行数:42,代码来源:menu_curses.py

示例10: InkTex

class InkTex(inkex.Effect):
    """
    Our main class, derived from inkex.Effect. It wraps the other classes and
    implements the effect() function.
    """

    def __init__(self):
        inkex.Effect.__init__(self)

        # the original (i.e., selected) svg element and the newly created one
        # including the original LaTeX source.
        self.orig = None
        self.orig_src = None
        self.new = None
        self.new_src = None

    def effect(self):
        """If there is an original element, store it. Open the GUI."""

        self.orig, self.orig_src = self.get_original()

        self.ui = Ui(self.render, self.orig_src, self.get_settings())
        self.ui.main()

    def render(self, tex, settings):
        """Execute the rendering and, upon errors, send them to the UI"""

        self.new_src = tex
        self.store_settings(settings)

        with Converter(self) as renderer:
            try:
                self.new = renderer.render(self.new_src, settings)
                self.copy_styles()
                self.store_src_information()
                self.append_or_replace()

                return True
            except Exception, e:
                self.ui.log(e.message)
开发者ID:janoliver,项目名称:inktex,代码行数:40,代码来源:inktex_cls.py

示例11: __init__

 def __init__(self):
     self.ui = Ui()
     self.popen_handler = None
     # flag stop, prevent thread start
     self.playing_flag = False
     self.pause_flag = False
     self.process_length = 0
     self.process_location = 0
     self.process_first = False
     self.storage = Storage()
     self.info = self.storage.database["player_info"]
     self.songs = self.storage.database["songs"]
     self.playing_id = -1
开发者ID:garfieldjty,项目名称:musicbox,代码行数:13,代码来源:player.py

示例12: __init__

 def __init__(self):
     self.ui = Ui()
     self.datatype = 'songs'
     self.popen_handler = None
     # flag stop, prevent thread start
     self.playing_flag = False
     self.pause_flag = False
     self.songs = []
     self.idx = 0
     self.next_music_p=False  #播放下一曲标志
     self.stop_sub=False  #结束自动播放下一曲,手动选择播放``
     self.mplayer_controller=os.path.join(tempfile.mkdtemp(),'mplayer_controller')
     os.mkfifo(self.mplayer_controller)  #临时文件``
开发者ID:dream1986,项目名称:musicbox-1,代码行数:13,代码来源:player.py

示例13: main

def main():
    ui = Ui()
    details = ui.get_details()
    status = admin.register(details,ui)
    if status == True:
        ui.display( "registration successed")
    else:
        ui.display("registration failed")
开发者ID:sundarrajans,项目名称:Alien-registration,代码行数:8,代码来源:main.py

示例14: __init__

 def __init__(self):
     self.ui = Ui()
     self.datatype = 'songs'
     self.popen_handler = None
     # flag stop, prevent thread start
     self.playing_flag = False
     self.pause_flag = False
     self.songs = []
     self.idx = 0
     self.volume = 60
     self.process_length = 0
     self.process_location = 0
     self.process_first = False
     self.playing_mode = 0
开发者ID:hushulin,项目名称:musicbox,代码行数:14,代码来源:player.py

示例15: __init__

 def __init__(self):
     self.config = Config()
     self.ui = Ui()
     self.popen_handler = None
     # flag stop, prevent thread start
     self.playing_flag = False
     self.pause_flag = False
     self.process_length = 0
     self.process_location = 0
     self.process_first = False
     self.storage = Storage()
     self.info = self.storage.database["player_info"]
     self.songs = self.storage.database["songs"]
     self.playing_id = -1
     self.cache = Cache()
     self.mpg123_parameters = self.config.get_item("mpg123_parameters")
开发者ID:sunyton,项目名称:musicbox,代码行数:16,代码来源:player.py


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