Skip to content

Commit

Permalink
small fix in files list , added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nithinmurali committed Mar 14, 2020
1 parent 724046f commit 749a13b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/source/authorization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,10 @@ You can create your own authentication method and pass them like this::
gc = pygsheets.authorize(custom_credentials=my_credentials)

This option will ignore any other parameters.

An example of creating credentials from secrect dict.::

SCOPES = ('https://www.googleapis.com/auth/spreadsheets', 'https://www.googleapis.com/auth/drive')
service_account_info = json.loads(secret_dict)
my_credentials = service_account.Credentials.from_service_account_info(service_account_info, scopes=SCOPES)
gc = pygsheets.authorize(custom_credentials=my_credentials)
6 changes: 3 additions & 3 deletions pygsheets/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ def spreadsheet_metadata(self, query='', only_team_drive=False):
supportsTeamDrives=True,
includeTeamDriveItems=True,
fields=FIELDS_TO_INCLUDE,
q=query)
q=query, pageSize=500, orderBy='recency')
if not result and not only_team_drive:
result = self.list(fields=FIELDS_TO_INCLUDE,
supportsTeamDrives=True,
includeTeamDriveItems=self.include_team_drive_items,
q=query)
q=query, pageSize=500, orderBy='recency')
return result
else:
return self.list(fields=FIELDS_TO_INCLUDE,
supportsTeamDrives=True,
includeTeamDriveItems=self.include_team_drive_items,
q=query)
q=query, pageSize=500, orderBy='recency')

def delete(self, file_id, **kwargs):
"""Delete a file by ID.
Expand Down

0 comments on commit 749a13b

Please sign in to comment.