7 outfile =
open(
"TileModule.sql",
"wt")
8 outfile.write(
"SET echo OFF;\n")
9 outfile.write(
"#set linesize 132;\n")
12 outfile.write(
"create table TileModule_data (\n")
13 outfile.write(
"TileModule_data_id number(10),\n")
14 outfile.write(
"PART number(10),\n")
15 outfile.write(
"MODNUM number(10),\n")
16 outfile.write(
"NAM varchar2(255),\n")
17 outfile.write(
"TYP number(10),\n")
18 outfile.write(
"COMM varchar2(255)\n")
19 outfile.write(
") ;\n")
21 outfile.write(
"alter table TileModule_data add constraint TileModule_data_pk\n")
22 outfile.write(
"primary key (TileModule_data_id);\n")
24 outfile.write(
"create table TileModule_data2tag (\n")
25 outfile.write(
" TileModule_vers varchar2(255),\n")
26 outfile.write(
" TileModule_data_id number(10)\n")
27 outfile.write(
") ;\n")
34 outfile =
open(
"TileModule.sql",
"awt")
36 outfile.write(
"comment on column TileModule_data.TileModule_data_id is ")
37 outfile.write(
"'Tile Modules description, version 05';\n")
38 outfile.write(
"comment on column TileModule_data.PART is ")
39 outfile.write(
"'Tile parts 0-TB Barrel, 1-Barrel, 2-Ext.Bar Neg, 3-Ext.Bar Pos, 4 - ITC Neg, 5 - ITC Pos';\n")
40 outfile.write(
"comment on column TileModule_data.MODNUM is 'Module index';\n")
41 outfile.write(
"comment on column TileModule_data.NAM is 'Module name (production label)';\n")
42 outfile.write(
"comment on column TileModule_data.TYP is 'Module type of contents 1,2,6050403';\n")
43 outfile.write(
"comment on column TileModule_data.COMM is 'Module Comments';\n")
50 inpfile =
open(
"TileModule-GEO-00",
"rt")
51 outfile =
open(
"TileModule.sql",
"awt")
52 line = modname = comment = volline = cindx =
' '
53 n1 = n2 = n3 = nmax = 0
59 line = inpfile.readline()
65 name = string.split(line)
84 volline =
str(indx)+
","+
str(n1)+
","+
str(n2)+
",'"+modname+
"',"+
str(n3)+
",'"+comment+
"'"
86 outfile.write(
"insert into TileModule_data (TileModule_data_id,PART,MODNUM,NAM,TYP,COMM) values (\n")
87 outfile.write(volline)
89 outfile.write(
"insert into TileModule_data2tag values ('TileModule-GEO-00', ")
94 print ' IndexError : ',nmax,
' ',name
101 print 'Tile wirh python '
103 print ' Tile Values ',
TileModule(
'TileModule-GEO-00')