File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -153,27 +153,27 @@ def notebook_execute(options, status):
153
153
# compute total code cells (for progress)
154
154
current_code_cell = 1
155
155
total_code_cells = sum (cell .cell_type == 'code' for cell in client .nb .cells )
156
-
157
- # find max id length (for progress)
158
- max_id_len = max (len (cell .id ) for cell in client .nb .cells )
159
156
157
+ # find max label length (for progress)
158
+ max_label_len = max (len (nb_cell_yaml_options (client .nb .metadata .kernelspec .language , cell ).get ('label' , '' )) for cell in client .nb .cells )
159
+
160
160
# execute the cells
161
161
for index , cell in enumerate (client .nb .cells ):
162
- # find cell id
163
- source_list = cell . source . split ( ' \n ' )
164
- cell_id = cell . id if any ( s . startswith ( "#| label" ) or s . startswith ( "#| id" ) for s in source_list ) else ""
165
- padding = "." * (max_id_len - len (cell_id ))
166
-
162
+ # read cell options
163
+ cell_options = nb_cell_yaml_options ( client . nb . metadata . kernelspec . language , cell )
164
+ cell_label = cell_options . get ( ' label' , '' )
165
+ padding = "." * (max_label_len - len (cell_label ))
166
+
167
167
# progress
168
168
progress = (not quiet ) and cell .cell_type == 'code' and index > 0
169
169
if progress :
170
170
status (" Cell {0}/{1}: '{2}'{3}..." .format (
171
171
current_code_cell - 1 ,
172
172
total_code_cells - 1 ,
173
- cell_id ,
173
+ cell_label ,
174
174
padding
175
175
))
176
-
176
+
177
177
# clear cell output
178
178
cell = cell_clear_output (cell )
179
179
You can’t perform that action at this time.
0 commit comments