Skip to content

Commit

Permalink
Merge branch 'hotfix/0.2.9' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzeman committed Dec 8, 2013
2 parents dbf8929 + 000606a commit 1c02de3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/caper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from caper.parsers.scene import SceneParser


__version_info__ = ('0', '2', '8')
__version_info__ = ('0', '2', '9')
__version_branch__ = 'master'

__version__ = "%s%s" % (
Expand Down
4 changes: 4 additions & 0 deletions src/caper/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ def xrange_six(start, stop=None, step=None):
return range(start)
else:
return xrange(start)


def delta_seconds(td):
return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 1e6) / 1e6
4 changes: 2 additions & 2 deletions src/caper/matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from caper.helpers import is_list_type, update_dict
from caper.helpers import is_list_type, update_dict, delta_seconds
from datetime import datetime
from logr import Logr
import re
Expand Down Expand Up @@ -64,7 +64,7 @@ def construct_patterns(self, pattern_groups):

self.regex[group_name].append((weight, weight_patterns))

Logr.info("Compiled %s patterns in %ss", compile_count, (datetime.now() - compile_start).total_seconds())
Logr.info("Compiled %s patterns in %ss", compile_count, delta_seconds(datetime.now() - compile_start))

def find_group(self, name):
for group_name, weight_groups in self.regex.items():
Expand Down

0 comments on commit 1c02de3

Please sign in to comment.