Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix all dangling commas, Add Sheets API snippets
- Loading branch information
Showing
29 changed files
with
642 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
var filesToDelete = []; | ||
/** | ||
* Helper methods for Google Sheets tests. | ||
*/ | ||
function Helpers() { | ||
this.filesToDelete = []; | ||
} | ||
|
||
Helpers.prototype.reset = function() { | ||
this.filesToDelete = []; | ||
}; | ||
|
||
Helpers.prototype.deleteFileOnCleanup = function(id) { | ||
this.filesToDelete.push(id); | ||
}; | ||
|
||
Helpers.prototype.cleanup = function() { | ||
filesToDelete.forEach(Drive.Files.remove); | ||
}; | ||
|
||
Helpers.prototype.createTestSpreadsheet = function() { | ||
var spreadsheet = SpreadsheetApp.create('Test Spreadsheet'); | ||
for (var i = 0; i < 3; ++i) { | ||
spreadsheet.appendRow([1, 2, 3]); | ||
} | ||
this.deleteFileOnCleanup(spreadsheet.getId()); | ||
return spreadsheet.getId(); | ||
}; | ||
|
||
Helpers.prototype.populateValues = function(spreadsheetId) { | ||
var batchUpdateRequest = Sheets.newBatchUpdateSpreadsheetRequest(); | ||
var repeatCellRequest = Sheets.newRepeatCellRequest(); | ||
|
||
var values = []; | ||
for (var i = 0; i < 10; ++i) { | ||
values[i] = []; | ||
for (var j = 0; j < 10; ++j) { | ||
values[i].push('Hello'); | ||
} | ||
} | ||
var range = 'A1:J10'; | ||
SpreadsheetApp.openById(spreadsheetId).getRange(range).setValues(values); | ||
SpreadsheetApp.flush(); | ||
}; |
Oops, something went wrong.
1 comment
on commit d1241cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how to do pls hulp
d1241cc?branch=d1241cc45155a6d3239a78d08a6379db96706884&diff=split#r52108258