Skip to content

Commit

Permalink
Merge pull request #8 from beckf/lsfixes
Browse files Browse the repository at this point in the history
Lsfixes
  • Loading branch information
beckf authored Mar 5, 2019
2 parents 10a0913 + af65f70 commit 2389d27
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 79 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Features include:

5) Click Save Settings and restart the application.

6) Go to the Authroize Tab and click the Authorize link. Login to LS using your admin login id and password.
6) Go to the Authorize Tab and click the Authorize link. Login to LS using your admin login id and password.

7) Grant your application access to the account. When granted, if you used localhost as the redirect, you will see an error not found page.
In the URL copy the token after the equals sign and paste this into the first text box. You must complete the next step within 30 seconds.
Expand Down
9 changes: 4 additions & 5 deletions lightspeed_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,17 @@ def get(self, source, parameters=None):
if int(r['@attributes']['count']) >= 100:
page_count = math.ceil(int(r['@attributes']['count']) / 100)
page = 1
offset = 0
while page <= page_count:
if page > 1:
offset = page * 100
if parameters:
p = self.request_bucket("get", url + "&offset=" + str(offset))
else:
p = self.request_bucket("get", url + "?offset=" + str(offset))
offset += 100
p = self.request_bucket("get", url + "&offset=" + str(offset))

# Append new data to original request
for i in p:
if type(p[i]) == list:
r[i].extend(p[i])

page += 1
return r

Expand Down
Loading

0 comments on commit 2389d27

Please sign in to comment.