| 2 | |
| 3 | |
| 4 | class Proxy(object): |
| 5 | def __init__(self): |
| 6 | self.id = 1 |
| 7 | self.ip = '' |
| 8 | self.port = '' |
| 9 | self.country = '' |
| 10 | self.anonymity = '' |
| 11 | self.https = '' |
| 12 | self.speed = '' |
| 13 | self.source = '' |
| 14 | self.vali_count = 0 |
| 15 | |
| 16 | def __str__(self): |
| 17 | data = { |
| 18 | 'ip': self.ip, |
| 19 | 'port': self.port, |
| 20 | 'country': self.country, |
| 21 | 'anonymity': self.anonymity, |
| 22 | 'https': self.https, |
| 23 | 'speed': self.speed, |
| 24 | 'source': self.source, |
| 25 | 'vali_count': self.vali_count, |
| 26 | } |
| 27 | |
| 28 | return str(data) |
| 29 | |
| 30 | def __dict__(self): |
| 31 | data = { |
| 32 | 'ip': self.ip, |
| 33 | 'port': self.port, |
| 34 | 'country': self.country, |
| 35 | 'anonymity': self.anonymity, |
| 36 | 'https': self.https, |
| 37 | 'speed': self.speed, |
| 38 | 'source': self.source, |
| 39 | 'vali_count': self.vali_count, |
| 40 | } |
| 41 | |
| 42 | return data |
| 43 | |
| 44 | def get_dict(self): |
| 45 | data = { |
| 46 | 'ip': self.ip, |
| 47 | 'port': self.port, |
| 48 | 'country': self.country, |
| 49 | 'anonymity': self.anonymity, |
| 50 | 'https': self.https, |
| 51 | 'speed': self.speed, |
| 52 | 'source': self.source, |
| 53 | 'vali_count': self.vali_count, |
| 54 | } |
| 55 | |
| 56 | return data |
| 57 | |
| 58 | def set_value(self, ip, port, country, anonymity, source='unkonw', https='no', speed=-1, vali_count=0): |
| 59 | self.ip = ip |
| 60 | self.port = port |
| 61 | self.country = country |
no outgoing calls
no test coverage detected