======
README
======

Let's test the source code with our checker:

  >>> import p01.checker
  >>> checker = p01.checker.Checker(p01.checker.CHECKS)

Add a page template checker based on our file path and domain:

  >>> ptChecker = p01.checker.PTBadI18nDomainChecker('/p01/', ('test',))
  >>> checker.addChecker('pt', ptChecker)

Add a zcml ocnfiguration file checker based on our file path and domain:

  >>> zcmlChecker = p01.checker.ZCMLBadI18nDomainChecker('/p01/', ('test',))
  >>> checker.addChecker('zcml', zcmlChecker)

Now let's check:

  >>> checker.check(p01.checker)
  ---------------
  sample/ascii.pt
  ---------------
  3: non ASCII char found
      Some german Umlautes äöü
                           ^
  --------------
  sample/bad.css
  --------------
  0: Property: Invalid value for "CSS Level 2.1" property: 100 [10:5: width]
  0: PropertyValue: No match: ('CHAR', u':', 15, 11)
  0: PropertyValue: Unknown syntax or no value:  100px
      height: 100px
  0: CSSStyleDeclaration: Syntax Error in Property: width: 100px
      height: 100px
  0: Property: Invalid value for "CSS Level 2.1" property: inline-block [20:5: font-size]
  0: CSSStyleRule: No start { of style declaration found: u'no comment\r\n' [26:1: ]
  0: CSSStyleRule: No style declaration or "}" found: u'no comment\r\n'
  -------------
  sample/bad.py
  -------------
  6: debug break point found
      import pdb; pdb.set_trace() # p01.checker.silence
  11: debug break point found
      pdb.set_trace() # p01.checker.silence
  20: debug break point found
      from pub.dbgpclient import brk # p01.checker.silence
  26: undefined name 'bar'
      return bar
  29: non ASCII char found
      return u'ö'
               ^
  ---------------------
  sample/console.log.js
  ---------------------
  2: javascript console.log found
      console.log('Testing console');
  6: javascript alert found
      alert("HERE: " + msg);
  ----------------
  sample/domain.pt
  ----------------
  3: empty i18n:domain="" found
      <div i18n:domain="">
  6: bad i18n domain found
      <div i18n:domain="foobar">
  ---------------
  sample/fatal.pt
  ---------------
  0: fatal error
      Opening and ending tag mismatch: div line 3 and span, line: 5, block: 12
      Opening and ending tag mismatch: div line 6 and body, line: 7, block: 10
      Opening and ending tag mismatch: body line 2 and html, line: 8, block: 8
      Premature end of data in tag html line 1, line: 9, block: 1
  -----------------
  sample/missing.pt
  -----------------
  0: fatal error
      line 3 needs i18n:domain
      <div i18n:translate="">foobar</div>
  -------------------
  sample/recruiter.po
  -------------------
  0: untranslated found
      1 items
  0: fuzzy found
      1 items
  --------------
  sample/tab.txt
  --------------
  3: tab found in file
      and here
