Browse files

paths are now just simple prefixes, not regexes

  • Loading branch information...
1 parent c86d25a commit 784f3c23a85d0153ac2bd49e4f7e2b04564d1be5 @jonallengriffin committed Apr 10, 2012
Showing with 6 additions and 10 deletions.
  1. +5 −9 synkamatic/api.py
  2. +1 −1 synkamatic/mozbase.py
View
14 synkamatic/api.py
@@ -3,7 +3,6 @@
"""
import json
from mozillapulse.consumers import CodeConsumer
-import re
import socket
import sys
@@ -16,7 +15,7 @@ class Synkamatic(object):
human-moderatable media
"""
- paths = [] # a list of regex's to match against paths in hg
+ paths = [] # a list of path prefixes to match against paths in hg
github = None # github repository
bugzilla = 'https://api-dev.bugzilla.mozilla.org/latest/' # REST API for bugzilla
reviewer = None # reviewer for github -> bugzilla patches
@@ -26,11 +25,8 @@ def __init__(self, github=None, paths=None, tree='mozilla-central',
pulsefile=None):
self.github = github or self.github
assert self.github, "github repository not specified!"
- filepaths = paths or self.paths
- assert filepaths, "paths not specified!"
- self.pathRegexs = []
- for path in filepaths:
- self.pathRegexs.append(re.compile(path))
+ self.path = paths or self.paths
+ assert self.paths, "paths not specified!"
self.tree = tree
self.pulsefile = pulsefile
@@ -74,8 +70,8 @@ def on_pulse_message(self, data, message):
# See if the affected files in the commit match any of our paths.
for affectedFile in data.get('payload', {}).get('affected_files', []):
- for path in self.pathRegexs:
- if path.match(affectedFile):
+ for path in self.paths:
+ if affectedFile.startswith(path):
self.on_matching_commit(data)
View
2 synkamatic/mozbase.py
@@ -12,7 +12,7 @@ class Mozbase(Synkamatic):
https://wiki.mozilla.org/Auto-tools/Projects/MozBase
"""
- paths = ['testing/mozbase'] # paths in m-c
+ paths = ['testing/mozbase/'] # paths in m-c
github = 'https://github.com/mozilla/mozbase'

0 comments on commit 784f3c2

Please sign in to comment.