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

Side by Side Diff: recipe_modules/shutil/example.expected/basic.json

Issue 2909983003: [loader] Make recipe engine support examples/ module subdir (Closed)
Patch Set: Created 3 years, 6 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 | « recipe_modules/shutil/example.py ('k') | recipe_modules/shutil/examples/full.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 [
2 {
3 "cmd": [
4 "python",
5 "-u",
6 "\nimport os\nimport sys\nos.remove(sys.argv[1])\n",
7 "bar"
8 ],
9 "name": "foo",
10 "~followup_annotations": [
11 "@@@STEP_LOG_LINE@python.inline@@@@",
12 "@@@STEP_LOG_LINE@python.inline@import os@@@",
13 "@@@STEP_LOG_LINE@python.inline@import sys@@@",
14 "@@@STEP_LOG_LINE@python.inline@os.remove(sys.argv[1])@@@",
15 "@@@STEP_LOG_END@python.inline@@@"
16 ]
17 },
18 {
19 "cmd": [
20 "python",
21 "-u",
22 "\nimport json, os, sys\nif os.path.exists(sys.argv[1]) and os.path.isdir( sys.argv[1]):\n with open(sys.argv[2], 'w') as f:\n json.dump(os.listdir(sys .argv[1]), f)\n",
23 "/fake/dir",
24 "/path/to/tmp/json"
25 ],
26 "name": "listdir fake dir",
27 "~followup_annotations": [
28 "@@@STEP_LOG_LINE@json.output@[@@@",
29 "@@@STEP_LOG_LINE@json.output@ \"file 1\", @@@",
30 "@@@STEP_LOG_LINE@json.output@ \"file 2\"@@@",
31 "@@@STEP_LOG_LINE@json.output@]@@@",
32 "@@@STEP_LOG_END@json.output@@@",
33 "@@@STEP_LOG_LINE@python.inline@@@@",
34 "@@@STEP_LOG_LINE@python.inline@import json, os, sys@@@",
35 "@@@STEP_LOG_LINE@python.inline@if os.path.exists(sys.argv[1]) and os.path .isdir(sys.argv[1]):@@@",
36 "@@@STEP_LOG_LINE@python.inline@ with open(sys.argv[2], 'w') as f:@@@",
37 "@@@STEP_LOG_LINE@python.inline@ json.dump(os.listdir(sys.argv[1]), f)@ @@",
38 "@@@STEP_LOG_END@python.inline@@@"
39 ]
40 },
41 {
42 "cmd": [
43 "some",
44 "command"
45 ],
46 "name": "manipulate file 1"
47 },
48 {
49 "cmd": [
50 "some",
51 "command"
52 ],
53 "name": "manipulate file 2"
54 },
55 {
56 "cmd": [
57 "echo",
58 "[TMP_BASE]/prefix_a_tmp_1"
59 ],
60 "name": "print prefix_a"
61 },
62 {
63 "cmd": [
64 "echo",
65 "[TMP_BASE]/prefix_b_tmp_2"
66 ],
67 "name": "print prefix_b"
68 },
69 {
70 "cmd": [
71 "python",
72 "-u",
73 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
74 "abcde",
75 "tmp_file.txt"
76 ],
77 "name": "write_simple"
78 },
79 {
80 "cmd": [
81 "python",
82 "-u",
83 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
84 "tmp_file.txt",
85 "/path/to/tmp/"
86 ],
87 "name": "read_simple"
88 },
89 {
90 "cmd": [
91 "python",
92 "-u",
93 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
94 "! ~&&",
95 "tmp_file.txt"
96 ],
97 "name": "write_symbols"
98 },
99 {
100 "cmd": [
101 "python",
102 "-u",
103 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
104 "tmp_file.txt",
105 "/path/to/tmp/"
106 ],
107 "name": "read_symbols"
108 },
109 {
110 "cmd": [
111 "python",
112 "-u",
113 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
114 "abcde fgh",
115 "tmp_file.txt"
116 ],
117 "name": "write_spaces"
118 },
119 {
120 "cmd": [
121 "python",
122 "-u",
123 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
124 "tmp_file.txt",
125 "/path/to/tmp/"
126 ],
127 "name": "read_spaces"
128 },
129 {
130 "cmd": [
131 "python",
132 "-u",
133 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
134 "ab\ncd\nefg\n",
135 "tmp_file.txt"
136 ],
137 "name": "write_multiline"
138 },
139 {
140 "cmd": [
141 "python",
142 "-u",
143 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
144 "tmp_file.txt",
145 "/path/to/tmp/"
146 ],
147 "name": "read_multiline"
148 },
149 {
150 "cmd": [
151 "python",
152 "-u",
153 "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os. path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n",
154 "[TMP_BASE]/copytree_example_tmp",
155 "511"
156 ],
157 "name": "makedirs makedirs",
158 "~followup_annotations": [
159 "@@@STEP_LOG_LINE@python.inline@@@@",
160 "@@@STEP_LOG_LINE@python.inline@import sys, os@@@",
161 "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@",
162 "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@",
163 "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@",
164 "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@",
165 "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@",
166 "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@",
167 "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@",
168 "@@@STEP_LOG_END@python.inline@@@"
169 ]
170 },
171 {
172 "cmd": [
173 "python",
174 "-u",
175 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
176 "some file content",
177 "[TMP_BASE]/copytree_example_tmp/dummy_file"
178 ],
179 "name": "write [TMP_BASE]/copytree_example_tmp/dummy_file"
180 },
181 {
182 "cmd": [
183 "python",
184 "-u",
185 "\nimport shutil\nimport sys\nshutil.copytree(sys.argv[1], sys.argv[2], sy mlinks=bool(sys.argv[3]))\n",
186 "[TMP_BASE]/copytree_example_tmp",
187 "[TMP_BASE]/copytree_example_tmp2",
188 "0"
189 ],
190 "name": "copytree"
191 },
192 {
193 "cmd": [
194 "python",
195 "-u",
196 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
197 "[TMP_BASE]/copytree_example_tmp2/dummy_file",
198 "/path/to/tmp/"
199 ],
200 "name": "read [TMP_BASE]/copytree_example_tmp2/dummy_file"
201 },
202 {
203 "cmd": [
204 "python",
205 "-u",
206 "\nimport glob\nimport sys\nwith open(sys.argv[1], 'w') as f:\n f.write(' \\n'.join(glob.glob(sys.argv[2])))\n",
207 "/path/to/tmp/",
208 "[TMP_BASE]/copytree_example_tmp/*"
209 ],
210 "name": "glob"
211 },
212 {
213 "cmd": [
214 "python",
215 "-u",
216 "RECIPE_MODULE[recipe_engine::shutil]/resources/rmtree.py",
217 "[TMP_BASE]/copytree_example_tmp"
218 ],
219 "name": "cleanup"
220 },
221 {
222 "cmd": [
223 "python",
224 "-u",
225 "RECIPE_MODULE[recipe_engine::shutil]/resources/rmtree.py",
226 "[TMP_BASE]/copytree_example_tmp2"
227 ],
228 "name": "cleanup2"
229 },
230 {
231 "name": "$result",
232 "recipe_result": null,
233 "status_code": 0
234 }
235 ]
OLDNEW
« no previous file with comments | « recipe_modules/shutil/example.py ('k') | recipe_modules/shutil/examples/full.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698