# -*- coding: utf-8 -*-
import re

class BillLine( object ):
    SMS_REGEX = r'TIM\s*Torpedo|Serviços\s*de\s*SMS'
    INTERNET_REGEX = r'TIM\s*(Wap\s*Fast|Connect\s*Fast)|BlackBerry\s*Professional\s*-\s*MB'

    def __init__( self, bill_line ):
        """
        Args:
            bill_line( dict ): A dict with all fields from a bill line
        """
        self.service_type = bill_line[ "Tpserv" ]

    def is_SMS( self ):
        """
        Detect if this bill line is relative to a SMS sending

        Returns:
            True if is a SMS sending otherwise return False
        """

        match = re.search( BillLine.SMS_REGEX, self.service_type, re.I )
        return bool( match )

    def is_internet( self ):
        """
        Detect if this bill line is relative to an internet access

        Returns:
            True if is relative to internet access otherwise return False
        """

        match = re.search( BillLine.INTERNET_REGEX, self.service_type, re.I )
        return bool( match )

    def retrieve_call_features( self ):
        """
        Returns:
            An integer flag with all features detected
        """
        return 0

    def is_long_distance_call( self ):
        """
        Returns:
            True if is a long distance call  otherwise return False
        """
        pass

    def is_local_call( self ):
        """
        Returns:
            True if is a local call  otherwise return False
        """
        pass

    def is_destiny_call_mobile( self ):
        """
        Returns:
            True if is a call to a mobile phone otherwise return False
        """
        pass

    def is_destiny_call_landline( self ):
        """
        Returns:
            True if is a call to a landline phone otherwise return False
        """
        pass

@@ -199,16 +199,91 @@
 *-%5Cs*MB'
+%0A    LONG_DISTANCE_CALL_REGEX = r'Chamadas%5Cs*Longa%5Cs*(Dist%C3%A2ncia%7CDistancia)'
 %0A%0A    de
@@ -1384,32 +1384,33 @@
         %22%22%22%0A
+%0A
         
 pass%0A%0A    de
@@ -1389,36 +1389,140 @@
    %22%22%22%0A%0A        
-pass
+match = re.search( BillLine.LONG_DISTANCE_CALL_REGEX, self.service_type, re.I )%0A        return bool( match )
 %0A%0A    def is_loc

impl is_long_distance_call