Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: sitescripts/extensions/pad/validation.py

Issue 6700499810123776: Issue 520 - Add German and Russian translation to PAD files (Closed)
Patch Set: Created June 12, 2014, 1:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sitescripts/extensions/pad/language.py ('k') | sitescripts/extensions/template/pad.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of the Adblock Plus web scripts, 1 # This file is part of the Adblock Plus web scripts,
2 # Copyright (C) 2006-2014 Eyeo GmbH 2 # Copyright (C) 2006-2014 Eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details. 11 # GNU General Public License for more details.
12 # 12 #
13 # You should have received a copy of the GNU General Public License 13 # You should have received a copy of the GNU General Public License
14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
15 15
16 import itertools 16 import itertools
17 import warnings 17 import warnings
18 import re 18 import re
19 import urllib2 19 import urllib2
20 from xml.dom import minidom 20 from xml.dom import minidom
21 from sitescripts.extensions.pad.language import get_pad_languages
21 22
22 FIELDS = [ 23 FIELDS = [
23 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'MASTER_PAD_VERSION'], r'^4\.0\Z' ), 24 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'MASTER_PAD_VERSION'], r'^4\.0\Z' ),
24 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'MASTER_PAD_EDITOR'], r'^[^<\x09] {0,100}\Z'), 25 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'MASTER_PAD_EDITOR'], r'^[^<\x09] {0,100}\Z'),
25 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'MASTER_PAD_INFO'], r'^[^<\x09]{0 ,1000}\Z'), 26 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'MASTER_PAD_INFO'], r'^[^<\x09]{0 ,1000}\Z'),
26 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'CERTIFIED'], r'^[YyNn]\Z'), 27 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'CERTIFIED'], r'^[YyNn]\Z'),
27 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'CERTIFICATE_ID'], r'^(crt\-[0-9A -Z]{12}|)\Z'), 28 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'CERTIFICATE_ID'], r'^(crt\-[0-9A -Z]{12}|)\Z'),
28 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'CERTIFICATE_LICENSE'], r'^(http\ :\/\/repository\.appvisor\.com\/crt\-[0-9a-z]{12}|)\Z'), 29 (['XML_DIZ_INFO', 'MASTER_PAD_VERSION_INFO', 'CERTIFICATE_LICENSE'], r'^(http\ :\/\/repository\.appvisor\.com\/crt\-[0-9a-z]{12}|)\Z'),
29 (['XML_DIZ_INFO', 'Company_Info', 'PublisherID'], r'^(pid-[0-9a-z]{12}|)\Z'), 30 (['XML_DIZ_INFO', 'Company_Info', 'PublisherID'], r'^(pid-[0-9a-z]{12}|)\Z'),
30 (['XML_DIZ_INFO', 'Company_Info', 'Company_Name'], r'^[^<\x09]{2,40}\Z'), 31 (['XML_DIZ_INFO', 'Company_Info', 'Company_Name'], r'^[^<\x09]{2,40}\Z'),
(...skipping 28 matching lines...) Expand all
59 (['XML_DIZ_INFO', 'Program_Info', 'Program_Release_Month'], r'^(0[1-9]|1[0-2]) \Z'), 60 (['XML_DIZ_INFO', 'Program_Info', 'Program_Release_Month'], r'^(0[1-9]|1[0-2]) \Z'),
60 (['XML_DIZ_INFO', 'Program_Info', 'Program_Release_Day'], r'^(0[1-9]|[12][0-9] |3[01])\Z'), 61 (['XML_DIZ_INFO', 'Program_Info', 'Program_Release_Day'], r'^(0[1-9]|[12][0-9] |3[01])\Z'),
61 (['XML_DIZ_INFO', 'Program_Info', 'Program_Release_Year'], r'^(19|20|21)[0-9]{ 2}\Z'), 62 (['XML_DIZ_INFO', 'Program_Info', 'Program_Release_Year'], r'^(19|20|21)[0-9]{ 2}\Z'),
62 (['XML_DIZ_INFO', 'Program_Info', 'Program_Cost_Dollars'], r'^([0-9]+(\.[0-9]{ 2})?)?\Z'), 63 (['XML_DIZ_INFO', 'Program_Info', 'Program_Cost_Dollars'], r'^([0-9]+(\.[0-9]{ 2})?)?\Z'),
63 (['XML_DIZ_INFO', 'Program_Info', 'Program_Cost_Other_Code'], r'^(AED|AFN|ALL| AMD|ANG|AOA|ARS|AUD|AWG|AZM|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP| BYR|BZD|CAD|CDF|CHF|CLP|CNY|COP|COU|CRC|CSD|CZK|CUP|CVE|CYP|DJF|DKK|DOP|DZD|EEK| EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHC|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR| ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR| LRD|LSL|LTL|LVL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRO|MTL|MUR|MVR|MWK|MXN|MYR|MZN| NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RUB|RWF|SAR|SBD| SCR|SDD|SEK|SGD|SHP|SIT|SKK|SLL|SOS|SRD|STD|SYP|SZL|THB|TJS|TMM|TND|TOP|TRY|TTD| TWD|TZS|UAH|UGX|USD|UYU|UZS|VEB|VND|VUV|WST|XAF|XCD|XOF|XPF|YER|ZAR|ZMK|ZWD)?\Z' ), 64 (['XML_DIZ_INFO', 'Program_Info', 'Program_Cost_Other_Code'], r'^(AED|AFN|ALL| AMD|ANG|AOA|ARS|AUD|AWG|AZM|BAM|BBD|BDT|BGN|BHD|BIF|BMD|BND|BOB|BRL|BSD|BTN|BWP| BYR|BZD|CAD|CDF|CHF|CLP|CNY|COP|COU|CRC|CSD|CZK|CUP|CVE|CYP|DJF|DKK|DOP|DZD|EEK| EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHC|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HRK|HTG|HUF|IDR| ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR| LRD|LSL|LTL|LVL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRO|MTL|MUR|MVR|MWK|MXN|MYR|MZN| NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RUB|RWF|SAR|SBD| SCR|SDD|SEK|SGD|SHP|SIT|SKK|SLL|SOS|SRD|STD|SYP|SZL|THB|TJS|TMM|TND|TOP|TRY|TTD| TWD|TZS|UAH|UGX|USD|UYU|UZS|VEB|VND|VUV|WST|XAF|XCD|XOF|XPF|YER|ZAR|ZMK|ZWD)?\Z' ),
64 (['XML_DIZ_INFO', 'Program_Info', 'Program_Cost_Other'], r'^([0-9]+(\.[0-9]{2} )?)?\Z'), 65 (['XML_DIZ_INFO', 'Program_Info', 'Program_Cost_Other'], r'^([0-9]+(\.[0-9]{2} )?)?\Z'),
65 (['XML_DIZ_INFO', 'Program_Info', 'Program_Type'], r'^(Shareware|Freeware|Adwa re|Demo|Commercial|Data Only)\Z'), 66 (['XML_DIZ_INFO', 'Program_Info', 'Program_Type'], r'^(Shareware|Freeware|Adwa re|Demo|Commercial|Data Only)\Z'),
66 (['XML_DIZ_INFO', 'Program_Info', 'Program_Release_Status'], r'^(Major Update| Minor Update|New Release|Beta|Alpha|Media Only)\Z'), 67 (['XML_DIZ_INFO', 'Program_Info', 'Program_Release_Status'], r'^(Major Update| Minor Update|New Release|Beta|Alpha|Media Only)\Z'),
67 (['XML_DIZ_INFO', 'Program_Info', 'Program_Install_Support'], r'^(Install and Uninstall|Install Only|No Install Support|Uninstall Only)\Z'), 68 (['XML_DIZ_INFO', 'Program_Info', 'Program_Install_Support'], r'^(Install and Uninstall|Install Only|No Install Support|Uninstall Only)\Z'),
68 (['XML_DIZ_INFO', 'Program_Info', 'Program_OS_Support'], r'^((Android|BlackBer ry|Handheld\/Mobile Other|iPhone|iPad|iPod|iTouch|Java|Linux|Linux Console|Linux Gnome|Linux GPL|Linux Open Source|Mac OS X|Mac Other|MS-DOS|Netware|OpenVMS|Pal m|Pocket PC|Symbian|Unix|Win2000|Win7 x32|Win7 x64|Win98|WinMobile|WinOther|WinS erver|WinVista|WinVista x64|WinXP|Windows 8|Windows Phone 7|Windows Phone 8|Wind ows RT|Other|Not Applicable)[, ]*)+\Z'), 69 (['XML_DIZ_INFO', 'Program_Info', 'Program_OS_Support'], r'^((Android|BlackBer ry|Handheld\/Mobile Other|iPhone|iPad|iPod|iTouch|Java|Linux|Linux Console|Linux Gnome|Linux GPL|Linux Open Source|Mac OS X|Mac Other|MS-DOS|Netware|OpenVMS|Pal m|Pocket PC|Symbian|Unix|Win2000|Win7 x32|Win7 x64|Win98|WinMobile|WinOther|WinS erver|WinVista|WinVista x64|WinXP|Windows 8|Windows Phone 7|Windows Phone 8|Wind ows RT|Other|Not Applicable)[, ]*)+\Z'),
69 (['XML_DIZ_INFO', 'Program_Info', 'Program_Language'], r'^(Abkhazian|Afar|Afri kaans|Albanian|Amharic|Arabic|Armenian|Assamese|Aymara|Azerbaijani|Bashkir|Basqu e|Bengali|Bhutani|Bihari|Bislama|Breton|Bulgarian|Burmese|Byelorussian|Cambodian |Catalan|Chinese|ChineseSimplified|ChineseTraditional|Corsican|Croatian|Czech|Da nish|Dutch|English|Esperanto|Estonian|Faeroese|Fiji|Finnish|French|Frisian|Gaeli c|Galician|Georgian|German|Greek|Greenlandic|Guarani|Gujarati|Hausa|Hebrew|Hindi |Hungarian|Icelandic|Indonesian|Interlingua|Interlingue|Inupiak|Irish|Italian|Ja panese|Javanese|Kannada|Kashmiri|Kazakh|Kinyarwanda|Kirghiz|Kirundi|Korean|Kurdi sh|Laothian|Latin|Latvian|Lingala|Lithuanian|Macedonian|Malagasy|Malay|Malayalam |Maltese|Maori|Marathi|Moldavian|Mongolian|Nauru|Nepali|Norwegian|Occitan|Oriya| Oromo|Other|Pashto|Persian|Polish|Portuguese|Punjabi|Quechua|Rhaeto-Romance|Roma nian|Russian|Samoan|Sangro|Sanskrit|Serbian|Serbo-Croatian|Sesotho|Setswana|Shon a|Sindhi|Singhalese|Siswati|Slovak|Slovenian|Somali|Spanish|Sudanese|Swahili|Swe dish|Tagalog|Tajik|Tamil|Tatar|Telugu|Thai|Tibetan|Tigrinya|Tonga|Tsonga|Turkish |Turkmen|Twi|Ukrainian|Urdu|Uzbek|Vietnamese|Volapuk|Welsh|Wolof|Xhosa|Yiddish|Y oruba|Zulu|,)+\Z'), 70 (['XML_DIZ_INFO', 'Program_Info', 'Program_Language'], r'^(%s|Other|,)+\Z' % ' |'.join(get_pad_languages())),
70 (['XML_DIZ_INFO', 'Program_Info', 'File_Info', 'File_Size_Bytes'], r'^[0-9]{3, 16}\Z'), 71 (['XML_DIZ_INFO', 'Program_Info', 'File_Info', 'File_Size_Bytes'], r'^[0-9]{3, 16}\Z'),
71 (['XML_DIZ_INFO', 'Program_Info', 'File_Info', 'File_Size_K'], r'^[0-9.]{1,12} \Z'), 72 (['XML_DIZ_INFO', 'Program_Info', 'File_Info', 'File_Size_K'], r'^[0-9.]{1,12} \Z'),
72 (['XML_DIZ_INFO', 'Program_Info', 'File_Info', 'File_Size_MB'], r'^[0-9.]{1,8} \Z'), 73 (['XML_DIZ_INFO', 'Program_Info', 'File_Info', 'File_Size_MB'], r'^[0-9.]{1,8} \Z'),
73 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Has_Expire_Info'], r'^[YyNn] \Z'), 74 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Has_Expire_Info'], r'^[YyNn] \Z'),
74 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Count'], r'^[0-9]{0,1 5}\Z'), 75 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Count'], r'^[0-9]{0,1 5}\Z'),
75 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Based_On'], r'^(Days| Uses|Either\/Or)?\Z'), 76 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Based_On'], r'^(Days| Uses|Either\/Or)?\Z'),
76 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Other_Info'], r'^[^<\ x09]{0,100}\Z'), 77 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Other_Info'], r'^[^<\ x09]{0,100}\Z'),
77 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Month'], r'^(0[1-9]|1 [0-2])?\Z'), 78 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Month'], r'^(0[1-9]|1 [0-2])?\Z'),
78 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Day'], r'^(0[1-9]|[12 ][0-9]|3[01])?\Z'), 79 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Day'], r'^(0[1-9]|[12 ][0-9]|3[01])?\Z'),
79 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Year'], r'^((19|20|21 )[0-9]{2})?\Z'), 80 (['XML_DIZ_INFO', 'Program_Info', 'Expire_Info', 'Expire_Year'], r'^((19|20|21 )[0-9]{2})?\Z'),
80 (['XML_DIZ_INFO', 'Program_Info', 'Program_Change_Info'], r'^[^<\x09]{0,300}\Z '), 81 (['XML_DIZ_INFO', 'Program_Info', 'Program_Change_Info'], r'^[^<\x09]{0,300}\Z '),
81 (['XML_DIZ_INFO', 'Program_Info', 'Program_Category_Class'], r'^(Audio &amp; M ultimedia::Audio Encoders\/Decoders|Audio &amp; Multimedia::Audio File Players|A udio &amp; Multimedia::Audio File Recorders|Audio &amp; Multimedia::CD Burners|A udio &amp; Multimedia::CD Players|Audio &amp; Multimedia::Multimedia Creation To ols|Audio &amp; Multimedia::Music Composers|Audio &amp; Multimedia::Other|Audio &amp; Multimedia::Presentation Tools|Audio &amp; Multimedia::Rippers &amp; Conve rters|Audio &amp; Multimedia::Speech|Audio &amp; Multimedia::Video Tools|Busines s::Accounting &amp; Finance|Business::Calculators &amp; Converters|Business::Dat abases &amp; Tools|Business::Helpdesk &amp; Remote PC|Business::Inventory &amp; Barcoding|Business::Investment Tools|Business::Math &amp; Scientific Tools|Busin ess::Office Suites &amp; Tools|Business::Other|Business::PIMS &amp; Calendars|Bu siness::Project Management|Business::Vertical Market Apps|Communications::Chat & amp; Instant Messaging|Communications::Dial Up &amp; Connection Tools|Communicat ions::E-Mail Clients|Communications::E-Mail List Management|Communications::Fax Tools|Communications::Newsgroup Clients|Communications::Other Comms Tools|Commun ications::Other E-Mail Tools|Communications::Pager Tools|Communications::Telepho ny|Communications::Web\/Video Cams|Desktop::Clocks &amp; Alarms|Desktop::Cursors &amp; Fonts|Desktop::Icons|Desktop::Other|Desktop::Screen Savers: Art|Desktop:: Screen Savers: Cartoons|Desktop::Screen Savers: Nature|Desktop::Screen Savers: O ther|Desktop::Screen Savers: People|Desktop::Screen Savers: Science|Desktop::Scr een Savers: Seasonal|Desktop::Screen Savers: Vehicles|Desktop::Themes &amp; Wall paper|Development::Active X|Development::Basic, VB, VB DotNet|Development::C \/ C\+\+ \/ C\#|Development::Compilers &amp; Interpreters|Development::Components & amp; Libraries|Development::Debugging|Development::Delphi|Development::Help Tool s|Development::Install &amp; Setup|Development::Management &amp; Distribution|De velopment::Other|Development::Source Editors|Education::Computer|Education::Dict ionaries|Education::Geography|Education::Kids|Education::Languages|Education::Ma thematics|Education::Other|Education::Reference Tools|Education::Science|Educati on::Teaching &amp; Training Tools|Games &amp; Entertainment::Action|Games &amp; Entertainment::Adventure &amp; Roleplay|Games &amp; Entertainment::Arcade|Games &amp; Entertainment::Board|Games &amp; Entertainment::Card|Games &amp; Entertain ment::Casino &amp; Gambling|Games &amp; Entertainment::Kids|Games &amp; Entertai nment::Online Gaming|Games &amp; Entertainment::Other|Games &amp; Entertainment: :Puzzle &amp; Word Games|Games &amp; Entertainment::Simulation|Games &amp; Enter tainment::Sports|Games &amp; Entertainment::Strategy &amp; War Games|Games &amp; Entertainment::Tools &amp; Editors|Graphic Apps::Animation Tools|Graphic Apps:: CAD|Graphic Apps::Converters &amp; Optimizers|Graphic Apps::Editors|Graphic Apps ::Font Tools|Graphic Apps::Gallery &amp; Cataloging Tools|Graphic Apps::Icon Too ls|Graphic Apps::Other|Graphic Apps::Screen Capture|Graphic Apps::Viewers|Home & amp; Hobby::Astrology\/Biorhythms\/Mystic|Home &amp; Hobby::Astronomy|Home &amp; Hobby::Cataloging|Home &amp; Hobby::Food &amp; Drink|Home &amp; Hobby::Genealog y|Home &amp; Hobby::Health &amp; Nutrition|Home &amp; Hobby::Other|Home &amp; Ho bby::Personal Finance|Home &amp; Hobby::Personal Interest|Home &amp; Hobby::Recr eation|Home &amp; Hobby::Religion|Network &amp; Internet::Ad Blockers|Network &a mp; Internet::Browser Tools|Network &amp; Internet::Browsers|Network &amp; Inter net::Download Managers|Network &amp; Internet::File Sharing\/Peer to Peer|Networ k &amp; Internet::FTP Clients|Network &amp; Internet::Network Monitoring|Network &amp; Internet::Other|Network &amp; Internet::Remote Computing|Network &amp; In ternet::Search\/Lookup Tools|Network &amp; Internet::Terminal &amp; Telnet Clien ts|Network &amp; Internet::Timers &amp; Time Synch|Network &amp; Internet::Trace &amp; Ping Tools|Security &amp; Privacy::Access Control|Security &amp; Privacy: :Anti-Spam &amp; Anti-Spy Tools|Security &amp; Privacy::Anti-Virus Tools|Securit y &amp; Privacy::Covert Surveillance|Security &amp; Privacy::Encryption Tools|Se curity &amp; Privacy::Other|Security &amp; Privacy::Password Managers|Servers::F irewall &amp; Proxy Servers|Servers::FTP Servers|Servers::Mail Servers|Servers:: News Servers|Servers::Other Server Applications|Servers::Telnet Servers|Servers: :Web Servers|System Utilities::Automation Tools|System Utilities::Backup &amp; R estore|System Utilities::Benchmarking|System Utilities::Clipboard Tools|System U tilities::File &amp; Disk Management|System Utilities::File Compression|System U tilities::Launchers &amp; Task Managers|System Utilities::Other|System Utilities ::Printer|System Utilities::Registry Tools|System Utilities::Shell Tools|System Utilities::System Maintenance|System Utilities::Text\/Document Editors|Web Devel opment::ASP &amp; PHP|Web Development::E-Commerce|Web Development::Flash Tools|W eb Development::HTML Tools|Web Development::Java &amp; JavaScript|Web Developmen t::Log Analysers|Web Development::Other|Web Development::Site Administration|Web Development::Wizards &amp; Components|Web Development::XML\/CSS Tools)\Z'), 82 (['XML_DIZ_INFO', 'Program_Info', 'Program_Category_Class'], r'^(Audio &amp; M ultimedia::Audio Encoders\/Decoders|Audio &amp; Multimedia::Audio File Players|A udio &amp; Multimedia::Audio File Recorders|Audio &amp; Multimedia::CD Burners|A udio &amp; Multimedia::CD Players|Audio &amp; Multimedia::Multimedia Creation To ols|Audio &amp; Multimedia::Music Composers|Audio &amp; Multimedia::Other|Audio &amp; Multimedia::Presentation Tools|Audio &amp; Multimedia::Rippers &amp; Conve rters|Audio &amp; Multimedia::Speech|Audio &amp; Multimedia::Video Tools|Busines s::Accounting &amp; Finance|Business::Calculators &amp; Converters|Business::Dat abases &amp; Tools|Business::Helpdesk &amp; Remote PC|Business::Inventory &amp; Barcoding|Business::Investment Tools|Business::Math &amp; Scientific Tools|Busin ess::Office Suites &amp; Tools|Business::Other|Business::PIMS &amp; Calendars|Bu siness::Project Management|Business::Vertical Market Apps|Communications::Chat & amp; Instant Messaging|Communications::Dial Up &amp; Connection Tools|Communicat ions::E-Mail Clients|Communications::E-Mail List Management|Communications::Fax Tools|Communications::Newsgroup Clients|Communications::Other Comms Tools|Commun ications::Other E-Mail Tools|Communications::Pager Tools|Communications::Telepho ny|Communications::Web\/Video Cams|Desktop::Clocks &amp; Alarms|Desktop::Cursors &amp; Fonts|Desktop::Icons|Desktop::Other|Desktop::Screen Savers: Art|Desktop:: Screen Savers: Cartoons|Desktop::Screen Savers: Nature|Desktop::Screen Savers: O ther|Desktop::Screen Savers: People|Desktop::Screen Savers: Science|Desktop::Scr een Savers: Seasonal|Desktop::Screen Savers: Vehicles|Desktop::Themes &amp; Wall paper|Development::Active X|Development::Basic, VB, VB DotNet|Development::C \/ C\+\+ \/ C\#|Development::Compilers &amp; Interpreters|Development::Components & amp; Libraries|Development::Debugging|Development::Delphi|Development::Help Tool s|Development::Install &amp; Setup|Development::Management &amp; Distribution|De velopment::Other|Development::Source Editors|Education::Computer|Education::Dict ionaries|Education::Geography|Education::Kids|Education::Languages|Education::Ma thematics|Education::Other|Education::Reference Tools|Education::Science|Educati on::Teaching &amp; Training Tools|Games &amp; Entertainment::Action|Games &amp; Entertainment::Adventure &amp; Roleplay|Games &amp; Entertainment::Arcade|Games &amp; Entertainment::Board|Games &amp; Entertainment::Card|Games &amp; Entertain ment::Casino &amp; Gambling|Games &amp; Entertainment::Kids|Games &amp; Entertai nment::Online Gaming|Games &amp; Entertainment::Other|Games &amp; Entertainment: :Puzzle &amp; Word Games|Games &amp; Entertainment::Simulation|Games &amp; Enter tainment::Sports|Games &amp; Entertainment::Strategy &amp; War Games|Games &amp; Entertainment::Tools &amp; Editors|Graphic Apps::Animation Tools|Graphic Apps:: CAD|Graphic Apps::Converters &amp; Optimizers|Graphic Apps::Editors|Graphic Apps ::Font Tools|Graphic Apps::Gallery &amp; Cataloging Tools|Graphic Apps::Icon Too ls|Graphic Apps::Other|Graphic Apps::Screen Capture|Graphic Apps::Viewers|Home & amp; Hobby::Astrology\/Biorhythms\/Mystic|Home &amp; Hobby::Astronomy|Home &amp; Hobby::Cataloging|Home &amp; Hobby::Food &amp; Drink|Home &amp; Hobby::Genealog y|Home &amp; Hobby::Health &amp; Nutrition|Home &amp; Hobby::Other|Home &amp; Ho bby::Personal Finance|Home &amp; Hobby::Personal Interest|Home &amp; Hobby::Recr eation|Home &amp; Hobby::Religion|Network &amp; Internet::Ad Blockers|Network &a mp; Internet::Browser Tools|Network &amp; Internet::Browsers|Network &amp; Inter net::Download Managers|Network &amp; Internet::File Sharing\/Peer to Peer|Networ k &amp; Internet::FTP Clients|Network &amp; Internet::Network Monitoring|Network &amp; Internet::Other|Network &amp; Internet::Remote Computing|Network &amp; In ternet::Search\/Lookup Tools|Network &amp; Internet::Terminal &amp; Telnet Clien ts|Network &amp; Internet::Timers &amp; Time Synch|Network &amp; Internet::Trace &amp; Ping Tools|Security &amp; Privacy::Access Control|Security &amp; Privacy: :Anti-Spam &amp; Anti-Spy Tools|Security &amp; Privacy::Anti-Virus Tools|Securit y &amp; Privacy::Covert Surveillance|Security &amp; Privacy::Encryption Tools|Se curity &amp; Privacy::Other|Security &amp; Privacy::Password Managers|Servers::F irewall &amp; Proxy Servers|Servers::FTP Servers|Servers::Mail Servers|Servers:: News Servers|Servers::Other Server Applications|Servers::Telnet Servers|Servers: :Web Servers|System Utilities::Automation Tools|System Utilities::Backup &amp; R estore|System Utilities::Benchmarking|System Utilities::Clipboard Tools|System U tilities::File &amp; Disk Management|System Utilities::File Compression|System U tilities::Launchers &amp; Task Managers|System Utilities::Other|System Utilities ::Printer|System Utilities::Registry Tools|System Utilities::Shell Tools|System Utilities::System Maintenance|System Utilities::Text\/Document Editors|Web Devel opment::ASP &amp; PHP|Web Development::E-Commerce|Web Development::Flash Tools|W eb Development::HTML Tools|Web Development::Java &amp; JavaScript|Web Developmen t::Log Analysers|Web Development::Other|Web Development::Site Administration|Web Development::Wizards &amp; Components|Web Development::XML\/CSS Tools)\Z'),
82 (['XML_DIZ_INFO', 'Program_Info', 'Program_Specific_Category'], r'^(Audio|Busi ness|Development Tools|Education|Games|Graphics|Home\/Hobby|Internet|Miscellaneo us|Screen Savers|Utilities)?\Z'), 83 (['XML_DIZ_INFO', 'Program_Info', 'Program_Specific_Category'], r'^(Audio|Busi ness|Development Tools|Education|Games|Graphics|Home\/Hobby|Internet|Miscellaneo us|Screen Savers|Utilities)?\Z'),
83 (['XML_DIZ_INFO', 'Program_Info', 'Program_System_Requirements'], r'^[^<\x09]{ 0,100}\Z'), 84 (['XML_DIZ_INFO', 'Program_Info', 'Program_System_Requirements'], r'^[^<\x09]{ 0,100}\Z'),
84 (['XML_DIZ_INFO', 'Program_Info', 'FacebookProductPage'], r'^((http|https):\/\ /.{4,120}|)\Z'), 85 (['XML_DIZ_INFO', 'Program_Info', 'FacebookProductPage'], r'^((http|https):\/\ /.{4,120}|)\Z'),
85 (['XML_DIZ_INFO', 'Program_Info', 'GooglePlusProductPage'], r'^((http|https):\ /\/.{4,120}|)\Z'), 86 (['XML_DIZ_INFO', 'Program_Info', 'GooglePlusProductPage'], r'^((http|https):\ /\/.{4,120}|)\Z'),
86 (['XML_DIZ_INFO', 'Program_Descriptions', 'English', 'Keywords'], r'^[^<\x09]{ 0,250}\Z'),
87 (['XML_DIZ_INFO', 'Program_Descriptions', 'English', 'Char_Desc_45'], r'^[^<\x 09\x0a\x0d]{0,45}\Z'),
88 (['XML_DIZ_INFO', 'Program_Descriptions', 'English', 'Char_Desc_80'], r'^[^<\x 09\x0a\x0d]{0,80}\Z'),
89 (['XML_DIZ_INFO', 'Program_Descriptions', 'English', 'Char_Desc_250'], r'^[^<\ x09\x0a\x0d]{0,250}\Z'),
90 (['XML_DIZ_INFO', 'Program_Descriptions', 'English', 'Char_Desc_450'], r'^[^<\ x09\x0a\x0d]{0,450}\Z'),
91 (['XML_DIZ_INFO', 'Program_Descriptions', 'English', 'Char_Desc_2000'], r'^[^< ]{0,2000}\Z'),
92 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_Info_URL'], r'^ (http|https):\/\/.{2,120}\Z'), 87 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_Info_URL'], r'^ (http|https):\/\/.{2,120}\Z'),
93 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_Order_URL'], r' ^((http|https):\/\/.{2,120})?\Z'), 88 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_Order_URL'], r' ^((http|https):\/\/.{2,120})?\Z'),
94 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_Screenshot_URL' ], r'^(http|https):\/\/.{2,120}\.(gif|jpg|png)\Z'), 89 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_Screenshot_URL' ], r'^(http|https):\/\/.{2,120}\.(gif|jpg|png)\Z'),
95 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_Icon_URL'], r'^ (http|https):\/\/.{2,120}\.(gif|jpg|png)\Z'), 90 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_Icon_URL'], r'^ (http|https):\/\/.{2,120}\.(gif|jpg|png)\Z'),
96 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_XML_File_URL'], r'^(http|https):\/\/.{2,120}\.(xml|cgi|php|asp)\Z'), 91 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Application_XML_File_URL'], r'^(http|https):\/\/.{2,120}\.(xml|cgi|php|asp)\Z'),
97 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Video_Link_1_URL'], r'^((ht tp|https):\/\/.{4,120}|)\Z'), 92 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Video_Link_1_URL'], r'^((ht tp|https):\/\/.{4,120}|)\Z'),
98 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Video_Link_2_URL'], r'^((ht tp|https):\/\/.{4,120}|)\Z'), 93 (['XML_DIZ_INFO', 'Web_Info', 'Application_URLs', 'Video_Link_2_URL'], r'^((ht tp|https):\/\/.{4,120}|)\Z'),
99 (['XML_DIZ_INFO', 'Web_Info', 'Download_URLs', 'Primary_Download_URL'], r'^(ht tp|https|ftp):\/\/.{2,120}\Z'), 94 (['XML_DIZ_INFO', 'Web_Info', 'Download_URLs', 'Primary_Download_URL'], r'^(ht tp|https|ftp):\/\/.{2,120}\Z'),
100 (['XML_DIZ_INFO', 'Web_Info', 'Download_URLs', 'Secondary_Download_URL'], r'^( (http|https|ftp):\/\/.{2,120})?\Z'), 95 (['XML_DIZ_INFO', 'Web_Info', 'Download_URLs', 'Secondary_Download_URL'], r'^( (http|https|ftp):\/\/.{2,120})?\Z'),
101 (['XML_DIZ_INFO', 'Web_Info', 'Download_URLs', 'Additional_Download_URL_1'], r '^((http|https|ftp):\/\/.{2,120})?\Z'), 96 (['XML_DIZ_INFO', 'Web_Info', 'Download_URLs', 'Additional_Download_URL_1'], r '^((http|https|ftp):\/\/.{2,120})?\Z'),
(...skipping 21 matching lines...) Expand all
123 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_PayPro_Product_ID'], None), 118 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_PayPro_Product_ID'], None),
124 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_PayPro_Maximum_Commission_Rate'], None), 119 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_PayPro_Maximum_Commission_Rate'], None),
125 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_Avangate_Order_Page'], None), 120 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_Avangate_Order_Page'], None),
126 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_Avangate_Vendor_ID'], None), 121 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_Avangate_Vendor_ID'], None),
127 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_Avangate_Product_ID'], None), 122 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_Avangate_Product_ID'], None),
128 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_Avangate_Maximum_Commission_Rate'] , None), 123 (['XML_DIZ_INFO', 'Affiliates', 'Affiliates_Avangate_Maximum_Commission_Rate'] , None),
129 (['XML_DIZ_INFO', 'ASP', 'ASP_Member'], r'^[YyNn]\Z'), 124 (['XML_DIZ_INFO', 'ASP', 'ASP_Member'], r'^[YyNn]\Z'),
130 (['XML_DIZ_INFO', 'ASP', 'ASP_Member_Number'], None), 125 (['XML_DIZ_INFO', 'ASP', 'ASP_Member_Number'], None),
131 ] 126 ]
132 127
128 for language in get_pad_languages():
129 FIELDS.extend([
130 (['XML_DIZ_INFO', 'Program_Descriptions', language, 'Keywords'], r'^[^<\x09] {0,250}\Z'),
131 (['XML_DIZ_INFO', 'Program_Descriptions', language, 'Char_Desc_45'], r'^[^<\ x09\x0a\x0d]{0,45}\Z'),
132 (['XML_DIZ_INFO', 'Program_Descriptions', language, 'Char_Desc_80'], r'^[^<\ x09\x0a\x0d]{0,80}\Z'),
133 (['XML_DIZ_INFO', 'Program_Descriptions', language, 'Char_Desc_250'], r'^[^< \x09\x0a\x0d]{0,250}\Z'),
134 (['XML_DIZ_INFO', 'Program_Descriptions', language, 'Char_Desc_450'], r'^[^< \x09\x0a\x0d]{0,450}\Z'),
135 (['XML_DIZ_INFO', 'Program_Descriptions', language, 'Char_Desc_2000'], r'^[^ <]{0,2000}\Z'),
136 ])
137
133 def validate_fields(fields, nodes, filename): 138 def validate_fields(fields, nodes, filename):
134 expected_nodes = set() 139 expected_nodes = set()
135 140
136 for node_name, fields in itertools.groupby(fields, lambda (path, regex): path[ 0]): 141 for node_name, fields in itertools.groupby(fields, lambda (path, regex): path[ 0]):
137 expected_nodes.add(node_name) 142 expected_nodes.add(node_name)
138 143
139 regex = None 144 regex = None
140 nested_fields = [] 145 nested_fields = []
141 for path, regex_ in fields: 146 for path, regex_ in fields:
142 if path == [node_name]: 147 if path == [node_name]:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 for field in doc.getElementsByTagName('Field'): 200 for field in doc.getElementsByTagName('Field'):
196 path, regex = [ 201 path, regex = [
197 ''.join(node.nodeValue for node in field.getElementsByTagName(name)[0].chi ldNodes) 202 ''.join(node.nodeValue for node in field.getElementsByTagName(name)[0].chi ldNodes)
198 for name in ('Path', 'RegEx') 203 for name in ('Path', 'RegEx')
199 ] 204 ]
200 print ' (%r, %s),' % (str(path).split('/'), "r'%s'" % regex if regex else ' None') 205 print ' (%r, %s),' % (str(path).split('/'), "r'%s'" % regex if regex else ' None')
201 print ']' 206 print ']'
202 207
203 if __name__ == '__main__': 208 if __name__ == '__main__':
204 print_fields() 209 print_fields()
OLDNEW
« no previous file with comments | « sitescripts/extensions/pad/language.py ('k') | sitescripts/extensions/template/pad.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld