def _partialParseWeekday(self, s, sourceTime):
        """
        test if giving C{s} matched CRE_WEEKDAY, used by L{parse()}

        @type  s:          string
        @param s:          date/time text to evaluate
        @type  sourceTime: struct_time
        @param sourceTime: C{struct_time} value to use as the base

        @rtype:  tuple
        @return: tuple of remained date/time text, datetime object and
                 an boolean value to describ if matched or not

        """
        parseStr = None
        chunk1 = chunk2 = ''

        ctx = self.currentContext
        log.debug('eval %s with context - %s, %s', s, ctx.hasDate, ctx.hasTime)

        # Weekday
        m = self.ptc.CRE_WEEKDAY.search(s)
        if m is not None:
            gv = m.group()
            if s not in self.ptc.dayOffsets:

                if (gv != s):
                    # capture remaining string
                    parseStr = gv
                    chunk1 = s[:m.start()]
                    chunk2 = s[m.end():]
                    s = '%s %s' % (chunk1, chunk2)
                else:
                    parseStr = s
                    s = ''

        if parseStr and not ctx.hasDate:
            debug and log.debug(
                'found (weekday) [%s][%s][%s]', parseStr, chunk1, chunk2)
            sourceTime = self._evalWeekday(parseStr, sourceTime)

        return s, sourceTime, bool(parseStr)
def _partialParseWeekday ( self , s , sourceTime ) : parseStr = None chunk1 = chunk2 = '' ctx = self . currentContext log . debug ( 'eval %s with context - %s, %s' , s , ctx . hasDate , ctx . hasTime ) m = self . ptc . CRE_WEEKDAY . search ( s ) if m is not None : gv = m . group ( ) if s not in self . ptc . dayOffsets : if ( gv != s ) : parseStr = gv chunk1 = s [ : m . start ( ) ] chunk2 = s [ m . end ( ) : ] s = '%s %s' % ( chunk1 , chunk2 ) else : parseStr = s s = '' if parseStr and not ctx . hasDate : debug and log . debug ( 'found (weekday) [%s][%s][%s]' , parseStr , chunk1 , chunk2 ) sourceTime = self . _evalWeekday ( parseStr , sourceTime ) return s , sourceTime , bool ( parseStr )
test if giving C{s} matched CRE_WEEKDAY, used by L{parse()}

        @type  s:          string
        @param s:          date/time text to evaluate
        @type  sourceTime: struct_time
        @param sourceTime: C{struct_time} value to use as the base

        @rtype:  tuple
        @return: tuple of remained date/time text, datetime object and
                 an boolean value to describ if matched or not