| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | #!/usr/bin/env python |
||
| 25 | class EPP: |
||
| 26 | def __init__(self, config): |
||
| 27 | self.config = config |
||
| 28 | self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
||
| 29 | self.socket.connect((self.config['host'], self.config['port'])) |
||
| 30 | self.ssl = ssl.wrap_socket(self.socket, |
||
| 31 | keyfile = self.config['keyfile'], |
||
| 32 | certfile = self.config['certfile'], |
||
| 33 | ca_certs = self.config['ca_certs']) |
||
| 34 | self.greeting = self.read() |
||
| 35 | self.config['start_time'] = datetime.now().isoformat(' ') |
||
| 36 | |||
| 37 | def command(self, xml): |
||
| 38 | self.write(xml) |
||
| 39 | return self.read() |
||
| 40 | |||
| 41 | def write(self, xml): |
||
| 42 | Net.write(self.ssl, xml) |
||
| 43 | |||
| 44 | def read(self): |
||
| 45 | return Net.read(self.ssl) |
||
| 46 | |||
| 48 |