Skip to content

Commit

Permalink
fix: PEP8 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe2803 committed Nov 20, 2021
1 parent 4770fb1 commit 04a74f9
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions sheetfu/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,8 @@ def set_value(self, value, batch_to=None):
def get_backgrounds(self):
"""
Get the backgrounds of the Range.
:return: 2D array of the background colors, of size matching the range coordinates.
:return: 2D array of the background colors, of size matching the range
coordinates.
:return: 2D matrix of the colors in hex format.
"""
return self.make_get_request(
Expand Down Expand Up @@ -621,9 +622,10 @@ def set_formulas(self, formulas, batch_to=None):

def persist_a1_data_range(self, a1):
"""
If a1 attribute is None (typically when we get_data_range, it calculates the a1 notation and range coordinates
based on the number of rows and columns found in the data.
:param data: raw response of a request for values to google sheets API.
If a1 attribute is None (typically when we get_data_range, it calculates
the a1 notation and range coordinates based on the number of rows
and columns found in the data.
:param a1: raw response of a request for values to google sheets API.
"""
if a1 is not None:
return a1
Expand Down Expand Up @@ -655,10 +657,12 @@ def persist_a1_data_range(self, a1):
sheet_name=self.sheet.name
)

def get_cell(self, row, column): # todo: have a custom error when row and/or column is 0
def get_cell(self, row, column):
row_number = self.coordinates.row + row - 1
column_number = self.coordinates.column + column - 1
a1 = convert_coordinates_to_a1(row_number, column_number, sheet_name=self.coordinates.sheet_name)
a1 = convert_coordinates_to_a1(
row_number, column_number, sheet_name=self.coordinates.sheet_name
)
return Range(
client=self.client,
sheet=self.sheet,
Expand Down Expand Up @@ -691,7 +695,8 @@ def add_dropdown(self, choices, strict=True, batch_to=None):

def get_grid_range(self):
"""
As explained here: https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#GridRange
As explained here:
https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets#GridRange
:return: the grid range for set requests.
"""
return {
Expand Down Expand Up @@ -729,5 +734,3 @@ def get_max_column(self):
:return: int
"""
return self.coordinates.column + self.coordinates.number_of_columns - 1


0 comments on commit 04a74f9

Please sign in to comment.