In Inspector, I'd like to know if/how I can implement the SetValue() into the Boa generated code so that I can insert newlines.
The goal is to create a TextCtl that has a default value that contains comments and instuctions to guide a user in adding/appending text that will then be read into a file.
This is one of those "mixing your code with Boa generated code" questions that isn't covered in the documentation - Lord knows that I searched the docs before I decided to post!
I'm fairly new to both Boa and Python but I've been developing code for years. I managed to get Boa to run on Lycroris and port a W2K Boa created application into it with some tweaks, now I'm going full steam and enjoying every second of this "new world", so I hope Riann and everybody else will bear with this old programmer as I explore and try to port old skills into Python via Boa.
TIA
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Tried to use wordpad and cut and paste into the Value box of Inspector, got the following:
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: SyntaxError: invalid syntaxTraceback (most recent call last):
09:39:02 PM: SyntaxError: invalid syntax File "C:\Python21\wxPython\tools\boa\Inspector.py", line 321, in OnPaste
09:39:03 PM: self.selDesgn.OnPasteSelected(event)
09:39:03 PM: File "C:\Python21\wxPython\tools\boa\Views\Designer.py", line 967, in OnPasteSelected
09:39:03 PM: string.split(Utils.readTextFromClipboard(), os.linesep))
09:39:03 PM: File "C:\Python21\wxPython\tools\boa\Views\InspectableViews.py", line 501,in pasteCtrls
09:39:03 PM: print 'PASTE ERROR', input
09:39:03 PM: File "C:\Python21\wxPython\tools\boa\Utils.py", line 441, in write
09:39:03 PM: sys.__stdout__.write(s)
09:39:03 PM: IOError: [Errno 9] Bad file descriptor
Interesting!
This is what I tried to paste:
<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >
<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >
<! - - /database/table/row - - >
/POST_JOURNAL_006/DATAAREA/POST_JOURNAL/JELINE
Still trying!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well I figured out my problem and the text is now nicely formatted, the code compiles and runs as expected, BUT when I try to view the wxDialog box that I've created, Designer gives me errors. A code snippet:
self.staticBox1 = wxStaticBox(id = wxID_WXDIALOG2STATICBOX1, label = 'XPath Data Extraction Definition', name = 'staticBox1', parent = self, pos = wxPoint(8, 8), size = wxSize(752, 408), style = 0)
strGenerator = ("<!-- XML XPath Data Extraction Definition -->\n\n"+
"<!-- The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using DB2TXT and specify this file as the XPath file, and DB2TXT should be able to generate a flat file that can be imported into a database or processed in other ways. -->\n\n"+
...
...
Designer gives the following error:
NameError: name strGenerator is not defined
I've researched this and tried numerous remedies to get Designer to accept the code but to no avail - anyone have any suggestions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In Inspector, I'd like to know if/how I can implement the SetValue() into the Boa generated code so that I can insert newlines.
The goal is to create a TextCtl that has a default value that contains comments and instuctions to guide a user in adding/appending text that will then be read into a file.
This is one of those "mixing your code with Boa generated code" questions that isn't covered in the documentation - Lord knows that I searched the docs before I decided to post!
I'm fairly new to both Boa and Python but I've been developing code for years. I managed to get Boa to run on Lycroris and port a W2K Boa created application into it with some tweaks, now I'm going full steam and enjoying every second of this "new world", so I hope Riann and everybody else will bear with this old programmer as I explore and try to port old skills into Python via Boa.
TIA
Tried to use wordpad and cut and paste into the Value box of Inspector, got the following:
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: PASTE ERROR
09:39:02 PM: ['<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >', '', '<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >', '', '<! - - /database/table/row - - >', '', '/POST_JOURNAL_))^/DATAAREA/POST_JOURNAL/JELINE', '']
09:39:02 PM: SyntaxError: invalid syntaxTraceback (most recent call last):
09:39:02 PM: SyntaxError: invalid syntax File "C:\Python21\wxPython\tools\boa\Inspector.py", line 321, in OnPaste
09:39:03 PM: self.selDesgn.OnPasteSelected(event)
09:39:03 PM: File "C:\Python21\wxPython\tools\boa\Views\Designer.py", line 967, in OnPasteSelected
09:39:03 PM: string.split(Utils.readTextFromClipboard(), os.linesep))
09:39:03 PM: File "C:\Python21\wxPython\tools\boa\Views\InspectableViews.py", line 501,in pasteCtrls
09:39:03 PM: print 'PASTE ERROR', input
09:39:03 PM: File "C:\Python21\wxPython\tools\boa\Utils.py", line 441, in write
09:39:03 PM: sys.__stdout__.write(s)
09:39:03 PM: IOError: [Errno 9] Bad file descriptor
Interesting!
This is what I tried to paste:
<! - - The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using the DME and specify this file as the XPATH file and DME will generate a flat file that can be imported into a database or processed in other ways. - - >
<! - - Place an XPath on its own line below. This XPath should define which XML tag to repeat on. For instance, if you have an XMl file that contains many rows of data, with each row cleanly defined by a ROW tag, then your XPath may look like: - - >
<! - - /database/table/row - - >
/POST_JOURNAL_006/DATAAREA/POST_JOURNAL/JELINE
Still trying!
Well I figured out my problem and the text is now nicely formatted, the code compiles and runs as expected, BUT when I try to view the wxDialog box that I've created, Designer gives me errors. A code snippet:
self.staticBox1 = wxStaticBox(id = wxID_WXDIALOG2STATICBOX1, label = 'XPath Data Extraction Definition', name = 'staticBox1', parent = self, pos = wxPoint(8, 8), size = wxSize(752, 408), style = 0)
strGenerator = ("<!-- XML XPath Data Extraction Definition -->\n\n"+
"<!-- The contents of this file define how to extract tabular data (rows & columns) from an XML data source. Process the XML file using DB2TXT and specify this file as the XPath file, and DB2TXT should be able to generate a flat file that can be imported into a database or processed in other ways. -->\n\n"+
...
...
Designer gives the following error:
NameError: name strGenerator is not defined
I've researched this and tried numerous remedies to get Designer to accept the code but to no avail - anyone have any suggestions?