| 52 | return -9001 |
| 53 | |
| 54 | def upload(self, filename, codetype, timeout): |
| 55 | data = {'method': 'upload', 'username': self.username, 'password': self.password, 'appid': self.appid, |
| 56 | 'appkey': self.appkey, 'codetype': str(codetype), 'timeout': str(timeout)} |
| 57 | file = {'file': filename} |
| 58 | response = self.request(data, file) |
| 59 | if response: |
| 60 | if response['ret'] and response['ret'] < 0: |
| 61 | return response['ret'] |
| 62 | else: |
| 63 | return response['cid'] |
| 64 | else: |
| 65 | return -9001 |
| 66 | |
| 67 | def result(self, cid): |
| 68 | data = {'method': 'result', 'username': self.username, 'password': self.password, 'appid': self.appid, |