<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Excel.Sheet> <meta name=Generator content="Microsoft Excel 11"> <link rel=File-List href="Compare_files/filelist.xml"> <link rel=Edit-Time-Data href="Compare_files/editdata.mso"> <link rel=OLE-Object-Data href="Compare_files/oledata.mso"> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>SCH</o:Author> <o:LastAuthor>SCH</o:LastAuthor> <o:Created>2006-12-04T20:05:00Z</o:Created> <o:LastSaved>2006-12-04T21:48:56Z</o:LastSaved> <o:Company>eCollege</o:Company> <o:Version>11.8107</o:Version> </o:DocumentProperties> </xml><![endif]--> <style> <!--table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";} @page {margin:1.0in .75in 1.0in .75in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-page-orientation:landscape;} .font6 {color:windowtext; font-size:8.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:"Courier New", monospace; mso-font-charset:0;} .font7 {color:fuchsia; font-size:8.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:"Courier New", monospace; mso-font-charset:0;} .font8 {color:blue; font-size:8.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:"Courier New", monospace; mso-font-charset:0;} .font10 {color:#993366; font-size:8.0pt; font-weight:700; font-style:normal; text-decoration:none; font-family:"Courier New", monospace; mso-font-charset:0;} .font11 {color:#993366; font-size:8.0pt; font-weight:700; font-style:normal; text-decoration:none; font-family:"Courier New", monospace; mso-font-charset:0;} tr {mso-height-source:auto;} col {mso-width-source:auto;} br {mso-data-placement:same-cell;} .style0 {mso-number-format:General; text-align:general; vertical-align:bottom; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial; mso-generic-font-family:auto; mso-font-charset:0; border:none; mso-protection:locked visible; mso-style-name:Normal; mso-style-id:0;} td {mso-style-parent:style0; padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial; mso-generic-font-family:auto; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;} .xl24 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; border-top:.5pt solid windowtext; border-right:none; border-bottom:none; border-left:.5pt solid windowtext;} .xl25 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext;} .xl26 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:none; border-bottom:none; border-left:.5pt solid windowtext;} .xl27 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0;} .xl28 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; border-top:none; border-right:none; border-bottom:none; border-left:.5pt solid windowtext;} .xl29 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext;} .xl30 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:none; border-bottom:none; border-left:.5pt solid windowtext;} .xl31 {mso-style-parent:style0; color:fuchsia; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:none;} .xl32 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; border-top:none; border-right:none; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext;} .xl33 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext;} .xl34 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:none; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext;} .xl35 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:none;} .xl36 {mso-style-parent:style0; color:fuchsia; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext;} .xl37 {mso-style-parent:style0; color:fuchsia; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:none; border-bottom:none; border-left:.5pt solid windowtext;} .xl38 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:none;} .xl39 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:none;} .xl40 {mso-style-parent:style0; color:green; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext;} .xl41 {mso-style-parent:style0; color:green; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:none; border-bottom:none; border-left:.5pt solid windowtext;} .xl42 {mso-style-parent:style0; color:green; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:none;} .xl43 {mso-style-parent:style0; color:#993366; font-size:8.0pt; font-weight:700; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext;} .xl44 {mso-style-parent:style0; color:#993366; font-size:8.0pt; font-weight:700; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:none; border-bottom:none; border-left:.5pt solid windowtext;} .xl45 {mso-style-parent:style0; color:#993366; font-size:8.0pt; font-weight:700; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:none;} .xl46 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center;} .xl47 {mso-style-parent:style0; color:green; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext;} .xl48 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; border-top:.5pt solid windowtext; border-right:none; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl49 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl50 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:none; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl51 {mso-style-parent:style0; color:fuchsia; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:none; background:silver; mso-pattern:auto none;} .xl52 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; border-top:none; border-right:none; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl53 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl54 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:none; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl55 {mso-style-parent:style0; color:fuchsia; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:none; background:silver; mso-pattern:auto none;} .xl56 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; border-top:none; border-right:none; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl57 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl58 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:none; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl59 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:none; background:silver; mso-pattern:auto none;} .xl60 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:none; background:silver; mso-pattern:auto none;} .xl61 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:none; border-right:.5pt solid windowtext; border-bottom:none; border-left:none; background:silver; mso-pattern:auto none;} .xl62 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; border-top:.5pt solid windowtext; border-right:none; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl63 {mso-style-parent:style0; color:#993366; font-size:8.0pt; font-weight:700; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:none; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl64 {mso-style-parent:style0; color:#993366; font-size:8.0pt; font-weight:700; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:none; background:silver; mso-pattern:auto none;} .xl65 {mso-style-parent:style0; color:green; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl66 {mso-style-parent:style0; color:green; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:none; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl67 {mso-style-parent:style0; color:green; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:none;} .xl68 {mso-style-parent:style0; color:#993366; font-size:8.0pt; font-weight:700; font-family:"Courier New", monospace; mso-font-charset:0; border:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl69 {mso-style-parent:style0; color:#993366; font-size:8.0pt; font-weight:700; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl70 {mso-style-parent:style0; color:#993366; font-size:8.0pt; font-weight:700; font-family:"Courier New", monospace; mso-font-charset:0; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:none; background:silver; mso-pattern:auto none;} .xl71 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; vertical-align:middle; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:none; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl72 {mso-style-parent:style0; font-size:8.0pt; font-family:"Courier New", monospace; mso-font-charset:0; text-align:center; vertical-align:middle; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; background:silver; mso-pattern:auto none;} .xl73 {mso-style-parent:style0; text-align:center; vertical-align:middle; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext;} --> </style> <!--[if gte mso 9]><xml> <x:ExcelWorkbook> <x:ExcelWorksheets> <x:ExcelWorksheet> <x:Name>Sheet1</x:Name> <x:WorksheetOptions> <x:DefaultRowHeight>225</x:DefaultRowHeight> <x:Print> <x:ValidPrinterInfo/> <x:HorizontalResolution>300</x:HorizontalResolution> <x:VerticalResolution>300</x:VerticalResolution> </x:Print> <x:Selected/> <x:Panes> <x:Pane> <x:Number>3</x:Number> <x:ActiveRow>62</x:ActiveRow> <x:ActiveCol>3</x:ActiveCol> </x:Pane> </x:Panes> <x:ProtectContents>False</x:ProtectContents> <x:ProtectObjects>False</x:ProtectObjects> <x:ProtectScenarios>False</x:ProtectScenarios> </x:WorksheetOptions> <x:PublishObjects> <x:PublishObject> <x:Id>8953</x:Id> <x:DivID>Compare_8953</x:DivID> <x:SourceType>SourceSheet</x:SourceType> <x:HtmlType>HtmlStatic</x:HtmlType> <x:Location HRef="C:\p4\shawnhladky_public\guest\shawn_hladky\P4.Net\doc\pythonsample\Compare.htm"/> </x:PublishObject> </x:PublishObjects> </x:ExcelWorksheet> <x:ExcelWorksheet> <x:Name>Sheet2</x:Name> <x:WorksheetOptions> <x:ProtectContents>False</x:ProtectContents> <x:ProtectObjects>False</x:ProtectObjects> <x:ProtectScenarios>False</x:ProtectScenarios> </x:WorksheetOptions> </x:ExcelWorksheet> <x:ExcelWorksheet> <x:Name>Sheet3</x:Name> <x:WorksheetOptions> <x:ProtectContents>False</x:ProtectContents> <x:ProtectObjects>False</x:ProtectObjects> <x:ProtectScenarios>False</x:ProtectScenarios> </x:WorksheetOptions> </x:ExcelWorksheet> </x:ExcelWorksheets> <x:WindowHeight>12270</x:WindowHeight> <x:WindowWidth>15195</x:WindowWidth> <x:WindowTopX>480</x:WindowTopX> <x:WindowTopY>30</x:WindowTopY> <x:ProtectStructure>False</x:ProtectStructure> <x:ProtectWindows>False</x:ProtectWindows> </x:ExcelWorkbook> </xml><![endif]--> </head> <body link=blue vlink=purple class=xl27> <table x:str border=0 cellpadding=0 cellspacing=0 width=817 style='border-collapse: collapse;table-layout:fixed;width:613pt'> <col class=xl46 width=28 style='mso-width-source:userset;mso-width-alt:1024; width:21pt'> <col class=xl29 width=385 style='mso-width-source:userset;mso-width-alt:14080; width:289pt'> <col class=xl30 width=13 style='mso-width-source:userset;mso-width-alt:475; width:10pt'> <col class=xl27 width=391 style='mso-width-source:userset;mso-width-alt:14299; width:293pt'> <tr height=15 style='height:11.25pt'> <td height=15 class=xl24 width=28 style='height:11.25pt;width:21pt'> </td> <td class=xl47 width=385 style='width:289pt'># Standard Python and P4Python</td> <td class=xl26 width=13 style='border-left:none;width:10pt'> </td> <td class=xl67 width=391 style='width:293pt'># IronPython and P4.Net</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl32 style='height:11.25pt'> </td> <td class=xl33> </td> <td class=xl34 style='border-left:none'> </td> <td class=xl35> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl48 style='height:11.25pt;border-top:none'> </td> <td class=xl49 style='border-top:none'> </td> <td class=xl50 style='border-top:none;border-left:none'> </td> <td class=xl51 style='border-top:none'>import<font class="font6"> clr</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt' x:num>1</td> <td class=xl53> </td> <td class=xl54 style='border-left:none'> </td> <td class=xl55>from<font class="font6"> System </font><font class="font7">import</font><font class="font6"> Array, String</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl56 style='height:11.25pt'> </td> <td class=xl57> </td> <td class=xl58 style='border-left:none'> </td> <td class=xl59>clr.AddReferenceToFile('<font class="font8">P4API.dll</font><font class="font6">')</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl36> </td> <td class=xl37 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl36>import<font class="font6"> p4 as P4API</font></td> <td class=xl37 style='border-left:none'> </td> <td class=xl31>import<font class="font6"> P4API</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl36> </td> <td class=xl37 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl48 style='height:11.25pt'> </td> <td class=xl49>p4 = P4API.P4()</td> <td class=xl50 style='border-left:none'> </td> <td class=xl60>p4 = P4API.P4Connection()</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt' x:num>2</td> <td class=xl53>p4.parse_forms()</td> <td class=xl54 style='border-left:none'> </td> <td class=xl61> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl56 style='height:11.25pt'> </td> <td class=xl57>p4.connect()</td> <td class=xl58 style='border-left:none'> </td> <td class=xl59>p4.Connect()</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29>lname = '<font class="font8">P4NetTestingSample</font><font class="font6">'</font></td> <td class=xl30 style='border-left:none'> </td> <td class=xl38>lname = '<font class="font8">P4NetTestingSample</font><font class="font6">'</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl40># build my label</td> <td class=xl41 style='border-left:none'> </td> <td class=xl42># build my label</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl48 style='height:11.25pt'> </td> <td class=xl49>labelForm = p4.fetch_label(lname)</td> <td class=xl50 style='border-left:none'> </td> <td class=xl60>labelForm = p4.Fetch_Form('<font class="font8">label</font><font class="font6">', lname)</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt'> </td> <td class=xl53>labelForm['<font class="font8">Description</font><font class="font6">'] = '</font><font class="font8">Created for P4.Net sample</font><font class="font6">'</font></td> <td class=xl54 style='border-left:none'> </td> <td class=xl61>labelForm['<font class="font8">Description</font><font class="font6">'] = '</font><font class="font8">Created for P4.Net sample</font><font class="font6">'</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt' x:num>3</td> <td class=xl53>view = ['<font class="font8">//guest/shawn_hladky/...</font><font class="font6">']</font></td> <td class=xl54 style='border-left:none'> </td> <td class=xl61>view = Array[String](['<font class="font8">//guest/shawn_hladky/...</font><font class="font6">'])</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt'> </td> <td class=xl53>labelForm['<font class="font8">View</font><font class="font6">'] = view</font></td> <td class=xl54 style='border-left:none'> </td> <td class=xl61>labelForm.ArrayFields['<font class="font8">View</font><font class="font6">'] = view</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl56 style='height:11.25pt'> </td> <td class=xl57>res = p4.save_label(labelForm)</td> <td class=xl58 style='border-left:none'> </td> <td class=xl59>res = p4.Save_Form(labelForm)</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td rowspan=2 height=30 class=xl71 style='border-bottom:.5pt solid black; height:22.5pt' x:num>4</td> <td class=xl69 style='border-left:none'>if<font class="font6"> len(p4.errors) > 0:</font></td> <td class=xl50 style='border-left:none'> </td> <td class=xl70>if<font class="font6"> res.HasErrors():</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl57 style='height:11.25pt;border-left:none'><span style='mso-spacerun:yes'> </span><font class="font11">for</font><font class="font6"> e </font><font class="font11">in</font><font class="font6"> p4.errors: print e</font></td> <td class=xl58 style='border-left:none'> </td> <td class=xl59><span style='mso-spacerun:yes'> </span><font class="font11">for</font><font class="font6"> e </font><font class="font11">in</font><font class="font6"> res.Errors: print e</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl40># My list of changes.<span style='mso-spacerun:yes'> </span>This is totally arbitrary</td> <td class=xl41 style='border-left:none'> </td> <td class=xl42># My list of changes.<span style='mso-spacerun:yes'> </span>This is totally arbitrary</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29>changes=['<font class="font8">5774</font><font class="font6">', '</font><font class="font8">5680</font><font class="font6">', '</font><font class="font8">5636</font><font class="font6">', '</font><font class="font8">5444</font><font class="font6">']</font></td> <td class=xl30 style='border-left:none'> </td> <td class=xl38>changes=['<font class="font8">5774</font><font class="font6">', '</font><font class="font8">5680</font><font class="font6">', '</font><font class="font8">5636</font><font class="font6">', '</font><font class="font8">5444</font><font class="font6">']</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29>sorted_changes = changes.sort()</td> <td class=xl30 style='border-left:none'> </td> <td class=xl38>sorted_changes = changes.sort()</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl40># dictionary: keyed by file, value = revision</td> <td class=xl41 style='border-left:none'> </td> <td class=xl42># dictionary: keyed by file, value = revision</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29>filerevs = {}</td> <td class=xl30 style='border-left:none'> </td> <td class=xl38>filerevs = {}</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl40># spin the description on each file</td> <td class=xl41 style='border-left:none'> </td> <td class=xl42># spin the description on each file</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl62 style='height:11.25pt' x:num>5</td> <td class=xl68>for<font class="font6"> chg </font><font class="font10">in</font><font class="font6"> p4.run_describe('</font><font class="font8">-s</font><font class="font6">', *changes):</font></td> <td class=xl63 style='border-left:none'> </td> <td class=xl64>for<font class="font6"> chg </font><font class="font10">in</font><font class="font6"> p4.Run('</font><font class="font8">describe</font><font class="font6">', '</font><font class="font8">-s</font><font class="font6">', *changes):</font></td> </tr> <tr height=15 style='height:11.25pt'> <td rowspan=2 height=30 class=xl71 style='border-bottom:.5pt solid black; height:22.5pt;border-top:none' x:num>6</td> <td class=xl49 style='border-top:none;border-left:none'><span style='mso-spacerun:yes'> </span>depotFiles = chg['<font class="font8">depotFile</font><font class="font6">']</font></td> <td class=xl50 style='border-top:none;border-left:none'> </td> <td class=xl60 style='border-top:none'><span style='mso-spacerun:yes'> </span>depotFiles = chg.ArrayFields['<font class="font8">depotFile</font><font class="font6">']</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl57 style='height:11.25pt;border-left:none'><span style='mso-spacerun:yes'> </span>revisions<span style='mso-spacerun:yes'> </span>= chg['<font class="font8">rev</font><font class="font6">']</font></td> <td class=xl58 style='border-left:none'> </td> <td class=xl59><span style='mso-spacerun:yes'> </span>revisions<span style='mso-spacerun:yes'> </span>= chg.ArrayFields['<font class="font8">rev</font><font class="font6">']</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl24 style='height:11.25pt;border-top:none'> </td> <td class=xl25 style='border-top:none'><span style='mso-spacerun:yes'> </span><font class="font10">for</font><font class="font6"> i </font><font class="font10">in</font><font class="font6"> range(0, len(depotFiles)):</font></td> <td class=xl26 style='border-top:none;border-left:none'> </td> <td class=xl39 style='border-top:none'><span style='mso-spacerun:yes'> </span><font class="font10">for</font><font class="font6"> i </font><font class="font10">in</font><font class="font6"> range(0, len(depotFiles)):</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29><span style='mso-spacerun:yes'> </span>key,value = depotFiles[i], revisions[i]</td> <td class=xl30 style='border-left:none'> </td> <td class=xl38><span style='mso-spacerun:yes'> </span>key,value = depotFiles[i], revisions[i]</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29><span style='mso-spacerun:yes'> </span>filerevs[key]=value</td> <td class=xl30 style='border-left:none'> </td> <td class=xl38><span style='mso-spacerun:yes'> </span>filerevs[key]=value</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl40># convert the dictionary to a list</td> <td class=xl41 style='border-left:none'> </td> <td class=xl42># convert the dictionary to a list</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29>flist = []</td> <td class=xl41 style='border-left:none'> </td> <td class=xl38>flist = []</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl43>for<font class="font6"> k,v </font><font class="font10">in</font><font class="font6"> filerevs.items():</font></td> <td class=xl30 style='border-left:none'> </td> <td class=xl45>for<font class="font6"> k,v </font><font class="font10">in</font><font class="font6"> filerevs.items():</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29><span style='mso-spacerun:yes'> </span>flist.append("%s#%s" % (k,v))</td> <td class=xl30 style='border-left:none'> </td> <td class=xl38><span style='mso-spacerun:yes'> </span>flist.append("%s#%s" % (k,v))</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl32 style='height:11.25pt'> </td> <td class=xl33> </td> <td class=xl34 style='border-left:none'> </td> <td class=xl35> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl48 style='height:11.25pt;border-top:none'> </td> <td class=xl65 style='border-top:none'># now I want to run in non-parsed mode</td> <td class=xl66 style='border-top:none;border-left:none'> </td> <td class=xl60 style='border-top:none'> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt'> </td> <td class=xl53>p4.disconnect()</td> <td class=xl54 style='border-left:none'> </td> <td class=xl61> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt'> </td> <td class=xl53>p4 = P4API.P4()</td> <td class=xl54 style='border-left:none'> </td> <td class=xl61> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt' x:num>7</td> <td class=xl53>p4.connect()</td> <td class=xl54 style='border-left:none'> </td> <td class=xl61> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl52 style='height:11.25pt'> </td> <td class=xl53> </td> <td class=xl54 style='border-left:none'> </td> <td class=xl61> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl56 style='height:11.25pt'> </td> <td class=xl57>out = p4.run('<font class="font8">labelsync</font><font class="font6">', '</font><font class="font8">-l</font><font class="font6">', lname, *flist)</font></td> <td class=xl58 style='border-left:none'> </td> <td class=xl59>out = p4.RunUnParsed('<font class="font8">labelsync</font><font class="font6">', '</font><font class="font8">-l</font><font class="font6">', lname, *flist)</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl43>for<font class="font6"> s </font><font class="font10">in</font><font class="font6"> out: </font><font class="font10">print</font><font class="font6"> s</font></td> <td class=xl44 style='border-left:none'> </td> <td class=xl45>for<font class="font6"> s </font><font class="font10">in</font><font class="font6"> out: </font><font class="font10">print</font><font class="font6"> s</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl40># delete the label to keep the public depot clean :-)</td> <td class=xl41 style='border-left:none'> </td> <td class=xl42># delete the label to keep the public depot clean :-)</td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29>p4.run('<font class="font8">label</font><font class="font6">', '</font><font class="font8">-d</font><font class="font6">', lname)</font></td> <td class=xl30 style='border-left:none'> </td> <td class=xl38>p4.RunUnParsed('<font class="font8">label</font><font class="font6">', '</font><font class="font8">-d</font><font class="font6">', lname)</font></td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl28 style='height:11.25pt'> </td> <td class=xl29> </td> <td class=xl30 style='border-left:none'> </td> <td class=xl38> </td> </tr> <tr height=15 style='height:11.25pt'> <td height=15 class=xl32 style='height:11.25pt'> </td> <td class=xl33>p4.disconnect()</td> <td class=xl34 style='border-left:none'> </td> <td class=xl35>p4.Disconnect()</td> </tr> <![if supportMisalignedColumns]> <tr height=0 style='display:none'> <td width=28 style='width:21pt'></td> <td width=385 style='width:289pt'></td> <td width=13 style='width:10pt'></td> <td width=391 style='width:293pt'></td> </tr> <![endif]> </table> </body> </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 7341 | Erik Purins |
p4.net --- pull p4.net#head |
||
//guest/shawn_hladky/P4.Net/release/1.0/doc/pythonsample/Compare.htm | |||||
#1 | 6106 | Shawn Hladky | P4.Net: Branching release 1.0 | ||
//guest/shawn_hladky/P4.Net/main/doc/pythonsample/Compare.htm | |||||
#1 | 5830 | Shawn Hladky | P4.Net: reorg to support release branches | ||
//guest/shawn_hladky/P4.Net/doc/pythonsample/Compare.htm | |||||
#1 | 5799 | Shawn Hladky | p4.net missing doc files |