@@ -38,7 +38,7 @@ def __init__(self):
3838 static_list_directors = ['J. J. Abrams' , 'Irvin Kershner' , 'George Lucas' , 'Richard Marquand' ,
3939 'Rian Johnson' , 'Gareth Edwards' ]
4040 USER_MOVIE_LIBRARY = ['ROGUE1' , 'SW_EP04' , 'SW_EP05' ]
41- MOVIE_DATABASE_IDS = ['SW_EP01 ' , 'SW_EP02' , 'SW_EP03' , 'ROGUE1' , 'SW_EP04' ,
41+ MOVIE_DATABASE_IDS = ['SW_EP1 ' , 'SW_EP02' , 'SW_EP03' , 'ROGUE1' , 'SW_EP04' ,
4242 'SW_EP05' , 'SW_EP06' , 'SW_EP07' , 'SW_EP08' , 'SW_EP09' ]
4343 MOVIE_DATABASE = {'SW_EP04' : {'title' : 'Star Wars: Episode IV - A New Hope' ,
4444 'rating' : 'PG' ,
@@ -52,13 +52,13 @@ def __init__(self):
5252 'actor' : ['Mark Hamill' , 'Harrison Ford' , 'Carrie Fisher' ,
5353 'Alec Guinness' , 'Peter Mayhew' , 'Anthony Daniels' ]
5454 },
55- 'SW_EP06' : {'title' : 'Star Wars: Episode IV - A New Hope ' ,
55+ 'SW_EP06' : {'title' : 'Star Wars: Episode VI - Return of the Jedi ' ,
5656 'rating' : 'PG' ,
5757 'director' : ['Richard Marquand' ],
5858 'actor' : ['Mark Hamill' , 'Harrison Ford' , 'Carrie Fisher' ,
5959 'Alec Guinness' , 'Peter Mayhew' , 'Anthony Daniels' ]
6060 },
61- 'SW_EP01 ' : {'title' : 'Star Wars: Episode I - The Phantom Menace' ,
61+ 'SW_EP1 ' : {'title' : 'Star Wars: Episode I - The Phantom Menace' ,
6262 'rating' : 'PG' ,
6363 'director' : ['George Lucas' ],
6464 'actor' : ['Liam Neeson' , 'Ewan McGregor' , 'Natalie Portman' , 'Jake Lloyd' ]
@@ -113,8 +113,10 @@ def instance_query_movie_ids(self) -> List[str]:
113113 """Demonstrates showing tabular hinting of tab completion information"""
114114 completions_with_desc = []
115115
116- for movie_id , movie_entry in self .MOVIE_DATABASE .items ():
117- completions_with_desc .append (argparse_completer .CompletionItem (movie_id , movie_entry ['title' ]))
116+ for movie_id in self .MOVIE_DATABASE_IDS :
117+ if movie_id in self .MOVIE_DATABASE :
118+ movie_entry = self .MOVIE_DATABASE [movie_id ]
119+ completions_with_desc .append (argparse_completer .CompletionItem (movie_id , movie_entry ['title' ]))
118120
119121 return completions_with_desc
120122
0 commit comments