Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: README.recipes.md

Issue 2993713003: Add file.filesizes to recipe engine core modules. (Closed)
Patch Set: -kwargs. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | recipe_modules/file/api.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!--- AUTOGENERATED BY `./recipes.py test train` --> 1 <!--- AUTOGENERATED BY `./recipes.py test train` -->
2 # Package documentation for [recipe\_engine](https://github.com/luci/recipes-py) 2 # Package documentation for [recipe\_engine](https://github.com/luci/recipes-py)
3 ## Table of Contents 3 ## Table of Contents
4 4
5 **[Recipe Modules](#recipe-modules)** 5 **[Recipe Modules](#recipe-modules)**
6 * [context](#recipe_modules--context) &mdash; The context module provides APIs for manipulating a few pieces of 'ambient' data that affect how steps are run. 6 * [context](#recipe_modules--context) &mdash; The context module provides APIs for manipulating a few pieces of 'ambient' data that affect how steps are run.
7 * [file](#recipe_modules--file) &mdash; File manipulation (read/write/delete/g lob) methods. 7 * [file](#recipe_modules--file) &mdash; File manipulation (read/write/delete/g lob) methods.
8 * [generator_script](#recipe_modules--generator_script) &mdash; A simplistic m ethod for running steps generated by an external script. 8 * [generator_script](#recipe_modules--generator_script) &mdash; A simplistic m ethod for running steps generated by an external script.
9 * [json](#recipe_modules--json) &mdash; Methods for producing and consuming JS ON. 9 * [json](#recipe_modules--json) &mdash; Methods for producing and consuming JS ON.
10 * [path](#recipe_modules--path) &mdash; All functions related to manipulating paths in recipes. 10 * [path](#recipe_modules--path) &mdash; All functions related to manipulating paths in recipes.
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 Args: 259 Args:
260 * name (str) - The name of the step. 260 * name (str) - The name of the step.
261 * dest (Path) - The directory to ensure. 261 * dest (Path) - The directory to ensure.
262 * mode (int) - The mode to use if the directory doesn't exist. This method 262 * mode (int) - The mode to use if the directory doesn't exist. This method
263 does not ensure the mode if the directory already exists (if you need 263 does not ensure the mode if the directory already exists (if you need
264 that behaviour, file a bug). 264 that behaviour, file a bug).
265 265
266 Raises file.Error if the path exists but is not a directory. 266 Raises file.Error if the path exists but is not a directory.
267 267
268 &mdash; **def [filesizes](/recipe_modules/file/api.py#L227)(self, name, files, t est_data=None):**
269
270 Returns list of filesizes for the given files.
271
272 Args:
273 * name (str) - The name of the step.
274 * files (list[Path]) - Paths to files.
275
276 Returns list[int], size of each file in bytes.
277
268 &mdash; **def [glob\_paths](/recipe_modules/file/api.py#L145)(self, name, source , pattern, test_data=()):** 278 &mdash; **def [glob\_paths](/recipe_modules/file/api.py#L145)(self, name, source , pattern, test_data=()):**
269 279
270 Performs glob expansion on `pattern`. 280 Performs glob expansion on `pattern`.
271 281
272 glob rules for `pattern` follow the same syntax as for the python `glob` 282 glob rules for `pattern` follow the same syntax as for the python `glob`
273 stdlib module. 283 stdlib module.
274 284
275 Args: 285 Args:
276 * name (str) - The name of the step. 286 * name (str) - The name of the step.
277 * source (Path) - The directory whose contents should be globbed. 287 * source (Path) - The directory whose contents should be globbed.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 Remove a file. 341 Remove a file.
332 342
333 Does not raise Error if the file doesn't exist. 343 Does not raise Error if the file doesn't exist.
334 344
335 Args: 345 Args:
336 * name (str) - The name of the step. 346 * name (str) - The name of the step.
337 * source (Path) - The file to remove. 347 * source (Path) - The file to remove.
338 348
339 Raises file.Error. 349 Raises file.Error.
340 350
341 &mdash; **def [rmcontents](/recipe_modules/file/api.py#L244)(self, name, source) :** 351 &mdash; **def [rmcontents](/recipe_modules/file/api.py#L266)(self, name, source) :**
342 352
343 Similar to rmtree, but removes only contents not the directory. 353 Similar to rmtree, but removes only contents not the directory.
344 354
345 This is useful e.g. when removing contents of current working directory. 355 This is useful e.g. when removing contents of current working directory.
346 Deleting current working directory makes all further getcwd calls fail 356 Deleting current working directory makes all further getcwd calls fail
347 until chdir is called. chdir would be tricky in recipes, so we provide 357 until chdir is called. chdir would be tricky in recipes, so we provide
348 a call that doesn't delete the directory itself. 358 a call that doesn't delete the directory itself.
349 359
350 Args: 360 Args:
351 * name (str) - The name of the step. 361 * name (str) - The name of the step.
352 * source (Path) - The directory whose contents should be removed. 362 * source (Path) - The directory whose contents should be removed.
353 363
354 Raises file.Error. 364 Raises file.Error.
355 365
356 &mdash; **def [rmglob](/recipe_modules/file/api.py#L262)(self, name, source, pat tern):** 366 &mdash; **def [rmglob](/recipe_modules/file/api.py#L284)(self, name, source, pat tern):**
357 367
358 Removes all entries in `source` matching the glob `pattern`. 368 Removes all entries in `source` matching the glob `pattern`.
359 369
360 Args: 370 Args:
361 * name (str) - The name of the step. 371 * name (str) - The name of the step.
362 * source (Path) - The directory whose contents should be filtered and 372 * source (Path) - The directory whose contents should be filtered and
363 removed. 373 removed.
364 * pattern (str) - The glob pattern to apply under `source`. Anything 374 * pattern (str) - The glob pattern to apply under `source`. Anything
365 matching this pattern will be removed. 375 matching this pattern will be removed.
366 376
367 Raises file.Error. 377 Raises file.Error.
368 378
369 &mdash; **def [rmtree](/recipe_modules/file/api.py#L227)(self, name, source):** 379 &mdash; **def [rmtree](/recipe_modules/file/api.py#L249)(self, name, source):**
370 380
371 Recursively removes a directory. 381 Recursively removes a directory.
372 382
373 This uses a native python on Linux/Mac, and uses `rd` on Windows to avoid 383 This uses a native python on Linux/Mac, and uses `rd` on Windows to avoid
374 issues w.r.t. path lengths and read-only attributes. If the directory is 384 issues w.r.t. path lengths and read-only attributes. If the directory is
375 gone already, this returns without error. 385 gone already, this returns without error.
376 386
377 Args: 387 Args:
378 * name (str) - The name of the step. 388 * name (str) - The name of the step.
379 * source (Path) - The directory to remove. 389 * source (Path) - The directory to remove.
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 1337
1328 [DEPS](/recipe_modules/url/tests/join.py#L5): [step](#recipe_modules--step), [ur l](#recipe_modules--url) 1338 [DEPS](/recipe_modules/url/tests/join.py#L5): [step](#recipe_modules--step), [ur l](#recipe_modules--url)
1329 1339
1330 &mdash; **def [RunSteps](/recipe_modules/url/tests/join.py#L11)(api):** 1340 &mdash; **def [RunSteps](/recipe_modules/url/tests/join.py#L11)(api):**
1331 ### *recipes* / [url:tests/validate\_url](/recipe_modules/url/tests/validate_url .py) 1341 ### *recipes* / [url:tests/validate\_url](/recipe_modules/url/tests/validate_url .py)
1332 1342
1333 [DEPS](/recipe_modules/url/tests/validate_url.py#L5): [properties](#recipe_modul es--properties), [step](#recipe_modules--step), [url](#recipe_modules--url) 1343 [DEPS](/recipe_modules/url/tests/validate_url.py#L5): [properties](#recipe_modul es--properties), [step](#recipe_modules--step), [url](#recipe_modules--url)
1334 1344
1335 &mdash; **def [RunSteps](/recipe_modules/url/tests/validate_url.py#L12)(api):** 1345 &mdash; **def [RunSteps](/recipe_modules/url/tests/validate_url.py#L12)(api):**
1336 1346
OLDNEW
« no previous file with comments | « no previous file | recipe_modules/file/api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698