-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmedia.py
445 lines (329 loc) · 8.2 KB
/
media.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
import webbrowser
class Movie(object):
"""This class represents movies entity, created to storage all information
related."""
def __init__(self):
""" Inits the movie instance."""
self.data = []
self._visits = 0
@property
def title(self):
"""Gets the title for a movie.
Args:
self: current instance.
Returns:
Movie title.
Raise:
None.
"""
return self._title
@title.setter
def title(self, value):
"""Sets the title for a movie.
Args:
value: A string with movie title.
Raise:
None.
"""
self._title = value
@title.deleter
def title(self):
del self._title
@property
def price(self):
"""Gets the price for a movie.
Args:
self: current instance.
Returns:
Movie price.
Raise:
None.
"""
return self._price
@price.setter
def price(self, value):
"""Sets the price for a movie.
Args:
value: A float with movie price.
Raise:
None.
"""
self._price = value
@price.deleter
def price(self):
del self._price
@property
def story_line(self):
"""Gets the story line for a movie.
Args:
self: current instance.
Returns:
Movie story line.
Raise:
None.
"""
return self._story_line
@story_line.setter
def story_line(self, value):
"""Sets the story line for a movie.
Args:
value: A string with movie story line.
Raise:
None.
"""
self._story_line = value
@story_line.deleter
def story_line(self):
del self._story_line
@property
def poster_image_url(self):
"""Gets the poster image url for a movie.
Args:
self: current instance.
Returns:
Movie poster image url.
Raise:
None.
"""
return self._poster_image_url
@poster_image_url.setter
def poster_image_url(self, value):
"""Sets the poster image url for a movie.
Args:
value: A string with movie poster image url.
Raise:
None.
"""
self._poster_image_url = value
@poster_image_url.deleter
def poster_image_url(self):
del self._poster_image_url
@property
def trailer_youtube_url(self):
"""Gets the trailer youtube url for a movie.
Args:
self: current instance.
Returns:
Movie trailer youtube url.
Raise:
None.
"""
return self._trailer_youtube_url
@trailer_youtube_url.setter
def trailer_youtube_url(self, value):
"""Sets the trailer youtube url for a movie.
Args:
value: A string with movie trailer youtube url.
Raise:
None.
"""
self._trailer_youtube_url = value
@trailer_youtube_url.deleter
def trailer_youtube_url(self):
del self._trailer_youtube_url
@property
def synopsis_url(self):
"""Gets the synopsis url for a movie.
Args:
self: current instance.
Returns:
Movie synopsis url.
Raise:
None.
"""
return self._synopsis_url
@synopsis_url.setter
def synopsis_url(self, value):
"""Set url to fully shows the content of movie.
Args:
value: A string with movie information url.
Raise:
None.
"""
self._synopsis_url = value
@synopsis_url.deleter
def synopsis_url(self):
del self._synopsis_url
@property
def publishment_date(self):
"""Gets the publishment date for a movie.
Args:
self: current instance.
Returns:
Movie publishment date.
Raise:
None.
"""
return self._publishment_date
@publishment_date.setter
def publishment_date(self, value):
"""Sets the publishment date for a movie.
Args:
value: A float with movie publishment date.
Raise:
None.
"""
self._publishment_date = value
@publishment_date.deleter
def publishment_date(self):
del self._publishment_date
@property
def visits(self):
"""Gets the visits for a movie.
Args:
self: current instance.
Returns:
Movie visits.
Raise:
None.
"""
return self._visits
@visits.setter
def visits(self, value):
"""Sets the visits for a movie.
Args:
value: A integer with movie visits.
Raise:
None.
"""
self._visits = value
@visits.deleter
def visits(self):
del self._visits
@property
def actor(self):
"""Gets the actor for a movie.
Args:
self: current instance.
Returns:
Movie actor.
Raise:
None.
"""
return self._actor
@actor.setter
def actor(self, value):
""" Allows to set actor to the movie
Args:
value: actor instance
Returns:
None.
Raises:
None.
"""
self._actor = value
@actor.deleter
def actor(self):
del self._actor
def show_trailer(self):
"""Shows movie trailer in browser.
Use the corresponding youtube url to show movie trailer by
using webbrowser
Args:
None.
Raise:
None.
"""
self.visits = self.visits + 1
webbrowser.open(self.trailer_youtube_url)
class Actor(object):
"""Represents actors of the movies"""
def __init__(self):
self.data = []
def __init__(self, name, gender, nationality, age):
self._name = name
self._gender = gender
self._nationality = nationality
self._age = age
@property
def name(self):
"""Gets the actor name.
Args:
self: current instance.
Returns:
Actor name.
Raise:
None.
"""
return self._name
@name.setter
def name(self, value):
"""Sets the name for an actor.
Args:
value: A string with actor name.
Raise:
None.
"""
self._name = value
@name.deleter
def name(self):
del self._name
@property
def gender(self):
"""Gets the actor gender.
Args:
self: current instance.
Returns:
Actor gender.
Raise:
None.
"""
return self._gender
@gender.setter
def gender(self, value):
"""Sets the gender for an actor.
Args:
value: A string with actor gender.
Raise:
None.
"""
self._gender = value
@gender.deleter
def gender(self):
del self._gender
@property
def nationality(self):
"""Gets the actor nationality.
Args:
self: current instance.
Returns:
Actor nationality.
Raise:
None.
"""
return self._nationality
@nationality.setter
def nationality(self, value):
"""Sets the nationality for an actor.
Args:
value: A string with actor nationality.
Raise:
None.
"""
self._nationality = value
@nationality.deleter
def nationality(self):
del self._nationality
@property
def age(self):
"""Gets the actor age.
Args:
self: current instance.
Returns:
Actor age.
Raise:
None.
"""
return self._age
@age.setter
def age(self, value):
"""Sets the age for an actor.
Args:
value: A string with actor age.
Raise:
None.
"""
self._age = value
@age.deleter
def age(self):
del self._age