source: phonelux_scrappers/classes/phoneoffer.py

Last change on this file was 895cd87, checked in by Marko <Marko@…>, 2 years ago

Refactored code

  • Property mode set to 100644
File size: 1.6 KB
Line 
1import json
2
3
4class PhoneOffer:
5
6 def __init__(self, *args):
7 if len(args) == 19:
8 self.offer_id = args[0]
9 self.offer_shop = args[1]
10 self.offer_name = args[2]
11 self.price = args[3]
12 self.ram_memory = args[4]
13 self.rom_memory = args[5]
14 self.color = args[6]
15 self.front_camera = args[7]
16 self.back_camera = args[8]
17 self.chipset = args[9]
18 self.battery = args[10]
19 self.operating_system = args[11]
20 self.cpu = args[12]
21 self.image_url = args[13]
22 self.offer_url = args[14]
23 self.last_updated = args[15]
24 self.is_validated = args[16]
25 self.offer_description = args[17]
26 self.offer_shop_code = args[18]
27
28 if len(args) == 18:
29 self.offer_shop = args[0]
30 self.offer_name = args[1]
31 self.price = args[2]
32 self.ram_memory = args[3]
33 self.rom_memory = args[4]
34 self.color = args[5]
35 self.front_camera = args[6]
36 self.back_camera = args[7]
37 self.chipset = args[8]
38 self.battery = args[9]
39 self.operating_system = args[10]
40 self.cpu = args[11]
41 self.image_url = args[12]
42 self.offer_url = args[13]
43 self.last_updated = args[14]
44 self.is_validated = args[15]
45 self.offer_description = args[16]
46 self.offer_shop_code = args[17]
47
48 def __str__(self):
49 return str(self.__dict__)
50
Note: See TracBrowser for help on using the repository browser.