Create a line in the Platforms Used table.
Usage
The Python script addPlatformOE2Table was written to create complex entries to the Platform/OE Used table in HTML. The data is created using the Add Platform/OE web form, received via email, and stored in a restricted database. Then the addPlatformOE2Table Python script is executed and a subset of the identifying information (company, platform, OS, notes, where used, and TRL) is transformed into a web page in HTML that displays a title and the new entry in a tabular form. After approval, the HTML is merged into the STRS snippet named PlatformRequest for the web page titled: Platforms Used.
Setup
- Install Python. See Python download site. The script was tested against Python 2.7 and Python 3.2.
- Create/find a working directory to store scripts and execution results for upload and download.
- Save the addPlatformOE2Table.python.txt script (from eRoom) to that working directory.
- Save the FormMail email, as UTF-8 (or Unicode) text, with the name identified on the line containing “Suggest_File_Name:”, into the working directory identified..
Create table entry for Platforms Used
A sample execution of addPlatformOE2Table.python.txt proceeded as follows:
>c:\Python27\python.exe addPlatformOE2Table.python.txt 2013-09-17_084156_xinx-+OE-1.txt Now = Sep 20, 2013, 09:44:15 = 20130920094415 fileIn = 2013-09-17_084156_xinc-+OE-1.txt subdirectory = => C:path\SoftwareDefinedRadio\STRS Repository 2013-09-17_084156_xinc-+OE-1.txt starts with no BOM => ascii Alias(1): 1252 = cp1252 Alias(2): windows_1252 = cp1252 2 aliases for cp1252 Reopen: 2013-09-17_084156_xinc-+OE-1.txt with encoding: cp1252 Found 45 colon-separated names and values. Type of STRS metadata is 'AddOE' USE(1) Company(OE_Company) = xinc ... The data will be added to the table in:Platforms UsedXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX;" src="https://strs.grc.nasa.gov/platform-request/embed/#?secret=fxEBZCPHWG" data-secret="fxEBZCPHWG" width="600" height="338" title="Embedded WordPress Post" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"> ********************************************************************************************* *** Created web file: Platform.OE.Table.Entry.20130920094415.html, containing 6 OE items. *** *********************************************************************************************
The output file Platform.OE.Table.Entry.20130920094415.html contained the following:
As stated in the web page output, the results may then be displayed as text in a text editor or when view source is used. The last line of the table is created by everything between “” and “”, inclusive, which should be copied and pasted into the snippets named PlatformRequest. Then the Update Snippets button should be clicked to complete the process. To verify, display the Platforms Used web page (may need a refresh).