Skip to content

Commit

Permalink
Smells fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gotlium committed Jan 12, 2016
1 parent 3eeb0d5 commit 08ae63b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions antigate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def send(self, captcha_file):
msg = exc_info()[1]
if str(msg) != 'ERROR_NO_SLOT_AVAILABLE':
raise AntiGateError(msg)
sleep(0.5)

def get(self, captcha_id=None):
self.logger.debug('Fetching result')
Expand Down
7 changes: 4 additions & 3 deletions antigate/backends/grab_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ def request(self, url):
self.grab.go(url)
return self.grab.response.code, self.get_response_body()

def setup(self, *args, **kwargs):
self.grab.setup(*args, **kwargs)
def setup(self, **kwargs):
self.grab.setup(**kwargs)

def upload(self, filename):
@staticmethod
def upload(filename):
return UploadFile(filename)

def reset(self):
Expand Down
2 changes: 1 addition & 1 deletion antigate/backends/requests_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def request(self, url):
self.r = requests.get(url, **self.config)
return self.r.status_code, self.r.text

def setup(self, *args, **kwargs):
def setup(self, **kwargs):
self.conf.update(kwargs)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion antigate/backends/urllib_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def request(self, url):
self.r = self.u.read()
return self.u.getcode(), self.r

def setup(self, *args, **kwargs):
def setup(self, **kwargs):
self.conf.update(kwargs)

@staticmethod
Expand Down

0 comments on commit 08ae63b

Please sign in to comment.