本文整理汇总了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()
示例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()
示例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 = {}
示例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()
示例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
示例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()
示例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 = {}
示例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
示例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
示例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)
示例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
示例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) #临时文件``
示例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")
示例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
示例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")