@@ -151,6 +151,7 @@ def __init__(self, file_path):
151
151
self .folders_common : tfo .FoldersCommon = self .__get_section (tfo .FoldersCommon )
152
152
self .date_options : tfo .DateOptions = self .__get_section (tfo .DateOptions )
153
153
self .extract : tfo .Extract = self .__get_section (tfo .Extract )
154
+ self .layout : tfo .Layout = self .__get_section (tfo .Layout )
154
155
155
156
def __delattr__ (self , attr ):
156
157
section = getattr (self , attr )
@@ -172,6 +173,7 @@ def sections(self):
172
173
yield self .folders_common
173
174
yield self .date_options
174
175
yield self .extract
176
+ yield self .layout
175
177
176
178
@staticmethod
177
179
def __remove_section_from_parent (parent , tag ) -> list [tuple [int , ET .Element ]]:
@@ -198,7 +200,11 @@ def __get_section(self, obj, enforce_list=False):
198
200
parent = self ._root .find ('.' )
199
201
# Gets elements within the parent element, with the appropriate section.tag
200
202
section : list [dict ] = list ()
203
+ print ('-' * 50 )
204
+ print (section )
201
205
for element in parent :
206
+ print ('-------------ELEMENT' )
207
+ print (section )
202
208
if element .tag .endswith (f'true...{ obj .tag } ' ) or element .tag == obj .tag :
203
209
item = xmltodict .parse (ET .tostring (element ))[element .tag ]
204
210
if not item :
@@ -224,6 +230,7 @@ def enforce_column(self, column, folder_name=None, remote_name=None):
224
230
- Create the folder if it doesn't exist
225
231
- Updating the metadata local-name to map to the column name
226
232
- Adding the column mapping to the mapping cols, if it doesn't exist
233
+ - Displaying the folders and sorting columns alphabetically
227
234
228
235
Args:
229
236
column (tfo.Column): The TableFile Column object
@@ -255,6 +262,11 @@ def enforce_column(self, column, folder_name=None, remote_name=None):
255
262
elif not folder :
256
263
self .folders_common .folder .add (tfo .Folder (name = folder_name , folder_item = [folder_item ]))
257
264
265
+ # Set display to show folders
266
+ self .layout .update (show_structure = 'true' )
267
+
268
+
269
+
258
270
# If a remote_name was provided, and the column is not a Tableau Calculation - enforce metadata
259
271
if not remote_name or column .calculation :
260
272
return None
0 commit comments