本文整理汇总了Python中fetcher.Fetcher.all_movies方法的典型用法代码示例。如果您正苦于以下问题:Python Fetcher.all_movies方法的具体用法?Python Fetcher.all_movies怎么用?Python Fetcher.all_movies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fetcher.Fetcher
的用法示例。
在下文中一共展示了Fetcher.all_movies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Application
# 需要导入模块: from fetcher import Fetcher [as 别名]
# 或者: from fetcher.Fetcher import all_movies [as 别名]
#.........这里部分代码省略.........
photo = ImageTk.PhotoImage(image)
self.imagelabel = Label( self.infcanvas, image=photo , anchor=CENTER, bg="white", width=POSTER_W, height=POSTER_H )
self.imagelabel.image = photo
self.imagelabel.grid(row=1, column=0, sticky=N+S+E+W)
def createDetailCanvas(self):
self.detailCanvas = Canvas( self.infcanvas, bg="white")
self.detailCanvas.grid(row=1, column=1, sticky=N+S+E+W)
def createDetailLabels(self):
MAX_MOVIE_WIDTH = 60
self.movielabel = Label( self.detailCanvas, bg="white", text='Movie name', width=MAX_MOVIE_WIDTH, justify=LEFT, anchor=W, padx=5, pady=10 )
self.movielabel.grid(row=0, column=0, columnspan=2, sticky=N+S+E+W)
self.yearlabel = Label( self.detailCanvas, bg="white", text='Year', justify=LEFT, anchor=W, padx=5, pady=10 )
self.yearlabel.grid(row=1, column=0, sticky=N+S+E+W)
self.ratinglabel = Label( self.detailCanvas, bg="white", text='Rating', justify=LEFT, anchor=W, padx=5, pady=10 )
self.ratinglabel.grid(row=1, column=1, sticky=N+S+E+W)
self.poplabel = Label( self.detailCanvas, bg="white", text='Popularity', justify=LEFT, anchor=W, padx=5, pady=10 )
self.poplabel.grid(row=2, column=0, sticky=N+S+E+W)
self.countrylabel = Label( self.detailCanvas, bg="white", text='Country', justify=RIGHT, anchor=W, padx=5, pady=10 )
self.countrylabel.grid(row=2, column=1, sticky=N+S+E+W)
self.overviewlabel = Label( self.detailCanvas, bg="white", text='Overview', justify=LEFT, anchor=W, padx=5, wraplength=500, pady=10 )
self.overviewlabel.grid(row=3, columnspan=2, sticky=N+S+E+W)
self.directorlabel = Label( self.detailCanvas, bg="white", text='Director', justify=LEFT, anchor=W, padx=5, pady=10 )
self.directorlabel.grid(row=4, column=1, sticky=N+S+E+W)
self.castlabel = Label( self.detailCanvas, bg="white", text='Cast', justify=LEFT, anchor=W, padx=5, pady=10 )
self.castlabel.grid(row=4, column=0, sticky=N+S+E+W)
name = self.listbox.get(0)
self.fetch_inf(name)
def updateSearch(self, event):
parameter = self.entry.get()
result = self.fetch.search_movie(parameter)
if not result:
result = ['No result found']
self.listbox.delete(0, END)
[ self.listbox.insert(END, item) for item in result ]
def OnEntryDown(self, event):
self.listbox.yview_scroll(1,"units")
curr = int( self.listbox.curselection()[0] )
if self.listbox.size()-1 == curr:
curr-=1
self.listbox.select_clear(curr)
self.listbox.select_set(curr+1)
name = self.listbox.get(curr+1)
self.fetch_inf(name)
def OnClicked(self, event):
curr = int( self.listbox.curselection()[0] )
name = self.listbox.get(curr)
self.fetch_inf(name)
def OnEntryUp(self, event):
self.listbox.yview_scroll(-1,"units")
curr = int( self.listbox.curselection()[0] )
if curr == 0:
curr=1
self.listbox.select_clear(curr)
self.listbox.select_set(curr-1)
name = self.listbox.get(curr-1)
self.fetch_inf(name)
def getOriginalList(self):
return self.fetch.all_movies()
def fetch_inf(self, name):
data = self.fetch.movie_inf(name)
self.movielabel.config(text=name)
self.yearlabel.config(text=data.get('year',''))
self.ratinglabel.config(text=data.get('rating',''))
self.overviewlabel.config(text=data.get('overview',''))
self.poplabel.config(text=data.get('popularity', ''))
self.countrylabel.config(text=data.get( 'country', '' ))
self.directorlabel.config(text=data.get('Director',[' '])[0])
if len( data.get('Actor',['']) ) > 5:
data['Actor'] = data['Actor'][:5]
self.castlabel.config(text='\n'.join( data.get('Actor',[''] )))
if data.has_key('Poster'):
self.create_poster(data['Poster'])
else:
pass
def create_poster(self, poster_url):
#poster_url = '__store/poster/934.jpg'
image = Image.open( poster_url )
#crop the poster
image = image.resize((POSTER_W, POSTER_H), Image.ANTIALIAS)
photo = ImageTk.PhotoImage(image)
self.imagelabel = Label( self.infcanvas, image=photo , anchor=CENTER, bg="white", width=POSTER_W, height=POSTER_H )
self.imagelabel.image = photo
self.imagelabel.grid(row=1, column=0, sticky=N+S+E+W)