from __future__ import unicode_literals

from core import *

def handle_bandiera(template):
    return template.get(1)

def handle_citazione(template):
    if template.params:
        return '« ' + sp(template.params[0]) + ' »'

class SnippetParser(SnippetParserBase):
    def strip_template(self, template, normalize, collapse):
        if template.name.matches('bandiera'):
            return handle_bandiera(template)
        elif template.name.matches('citazione'):
            return handle_citazione(template)
        return super(SnippetParser, self).strip_template(
                template, normalize, collapse)

from __future__ import unicode_literals

from core import *

class SnippetParser(SnippetParserBase):
    def strip_template(self, template, normalize, collapse):
        if template.name.matches('bandiera'):
            return self.handle_bandiera(template)
        elif template.name.matches('citazione'):
            return self.handle_citazione(template)
        return super(SnippetParser, self).strip_template(
                template, normalize, collapse)

    def handle_bandiera(template):
        return template.get(1)

    def handle_citazione(template):
        if template.params:
            return '« ' + self.sp(template.params[0]) + ' »'

Fix snippet parser for Italian.
Fix snippet parser for Italian.


Former-commit-id: bb8d10f5f8301fbcd4f4232612bf722d380a3d10
  from __future__ import unicode_literals
  
  from core import *
  
- def handle_bandiera(template):
-     return template.get(1)
- 
- def handle_citazione(template):
-     if template.params:
-         return '« ' + sp(template.params[0]) + ' »'
- 
  class SnippetParser(SnippetParserBase):
      def strip_template(self, template, normalize, collapse):
          if template.name.matches('bandiera'):
-             return handle_bandiera(template)
+             return self.handle_bandiera(template)
          elif template.name.matches('citazione'):
-             return handle_citazione(template)
+             return self.handle_citazione(template)
          return super(SnippetParser, self).strip_template(
                  template, normalize, collapse)
  
+     def handle_bandiera(template):
+         return template.get(1)
+ 
+     def handle_citazione(template):
+         if template.params:
+             return '« ' + self.sp(template.params[0]) + ' »'
+ 
Fix snippet parser for Italian.
## Code Before:
from __future__ import unicode_literals

from core import *

def handle_bandiera(template):
    return template.get(1)

def handle_citazione(template):
    if template.params:
        return '« ' + sp(template.params[0]) + ' »'

class SnippetParser(SnippetParserBase):
    def strip_template(self, template, normalize, collapse):
        if template.name.matches('bandiera'):
            return handle_bandiera(template)
        elif template.name.matches('citazione'):
            return handle_citazione(template)
        return super(SnippetParser, self).strip_template(
                template, normalize, collapse)

## Instruction:
Fix snippet parser for Italian.
## Code After:
from __future__ import unicode_literals

from core import *

class SnippetParser(SnippetParserBase):
    def strip_template(self, template, normalize, collapse):
        if template.name.matches('bandiera'):
            return self.handle_bandiera(template)
        elif template.name.matches('citazione'):
            return self.handle_citazione(template)
        return super(SnippetParser, self).strip_template(
                template, normalize, collapse)

    def handle_bandiera(template):
        return template.get(1)

    def handle_citazione(template):
        if template.params:
            return '« ' + self.sp(template.params[0]) + ' »'
