
from buildbot.scheduler import Scheduler
from buildbot.changes.filter import ChangeFilter

from master.factory import syzygy_factory


def win():
  return syzygy_factory.SyzygyFactory('src/syzygy',
                                      target_platform='win32')


def _VersionFileFilter(change):
  """A change filter function that disregards all changes that don't
  touch src/syzygy/VERSION.

  Args:
      change: a buildbot Change object.
  """
  return change.branch == 'trunk' and 'syzygy/VERSION' in change.files

#
# Official build scheduler for Syzygy
#
official_scheduler = Scheduler('syzygy_version',
                               treeStableTimer=0,
                               change_filter=ChangeFilter(
                                  filter_fn=_VersionFileFilter),
                               builderNames=['Syzygy Official'])

#
# Windows official Release builder
#
official_factory = win().SyzygyFactory(official_release=True)

official_builder = {
    'name': 'Syzygy Official',
    'factory': official_factory,
    'schedulers': 'syzygy_version',
    'auto_reboot': False,
    'category': 'official',
    }


def Update(config, active_master, c):
  c['schedulers'].append(official_scheduler)
  c['builders'].append(official_builder)


from buildbot.scheduler import Scheduler
# This is due to buildbot 0.7.12 being used for the presubmit check.
from buildbot.changes.filter import ChangeFilter  # pylint: disable=E0611,F0401

from master.factory import syzygy_factory


def win():
  return syzygy_factory.SyzygyFactory('src/syzygy',
                                      target_platform='win32')


def _VersionFileFilter(change):
  """A change filter function that disregards all changes that don't
  touch src/syzygy/VERSION.

  Args:
      change: a buildbot Change object.
  """
  return change.branch == 'trunk' and 'syzygy/VERSION' in change.files

#
# Official build scheduler for Syzygy
#
official_scheduler = Scheduler('syzygy_version',
                               treeStableTimer=0,
                               change_filter=ChangeFilter(
                                  filter_fn=_VersionFileFilter),
                               builderNames=['Syzygy Official'])

#
# Windows official Release builder
#
official_factory = win().SyzygyFactory(official_release=True)

official_builder = {
    'name': 'Syzygy Official',
    'factory': official_factory,
    'schedulers': 'syzygy_version',
    'auto_reboot': False,
    'category': 'official',
    }


def Update(config, active_master, c):
  c['schedulers'].append(official_scheduler)
  c['builders'].append(official_builder)

Fix pylint presubmit check, related to buildbot 0.8.x vs 0.7.x
Fix pylint presubmit check, related to buildbot 0.8.x vs 0.7.x

TBR=nsylvain@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/7631036

git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@97254 0039d316-1c4b-4281-b951-d872f2087c98

  
  from buildbot.scheduler import Scheduler
+ # This is due to buildbot 0.7.12 being used for the presubmit check.
- from buildbot.changes.filter import ChangeFilter
+ from buildbot.changes.filter import ChangeFilter  # pylint: disable=E0611,F0401
  
  from master.factory import syzygy_factory
  
  
  def win():
    return syzygy_factory.SyzygyFactory('src/syzygy',
                                        target_platform='win32')
  
  
  def _VersionFileFilter(change):
    """A change filter function that disregards all changes that don't
    touch src/syzygy/VERSION.
  
    Args:
        change: a buildbot Change object.
    """
    return change.branch == 'trunk' and 'syzygy/VERSION' in change.files
  
  #
  # Official build scheduler for Syzygy
  #
  official_scheduler = Scheduler('syzygy_version',
                                 treeStableTimer=0,
                                 change_filter=ChangeFilter(
                                    filter_fn=_VersionFileFilter),
                                 builderNames=['Syzygy Official'])
  
  #
  # Windows official Release builder
  #
  official_factory = win().SyzygyFactory(official_release=True)
  
  official_builder = {
      'name': 'Syzygy Official',
      'factory': official_factory,
      'schedulers': 'syzygy_version',
      'auto_reboot': False,
      'category': 'official',
      }
  
  
  def Update(config, active_master, c):
    c['schedulers'].append(official_scheduler)
    c['builders'].append(official_builder)
  
Fix pylint presubmit check, related to buildbot 0.8.x vs 0.7.x
## Code Before:

from buildbot.scheduler import Scheduler
from buildbot.changes.filter import ChangeFilter

from master.factory import syzygy_factory


def win():
  return syzygy_factory.SyzygyFactory('src/syzygy',
                                      target_platform='win32')


def _VersionFileFilter(change):
  """A change filter function that disregards all changes that don't
  touch src/syzygy/VERSION.

  Args:
      change: a buildbot Change object.
  """
  return change.branch == 'trunk' and 'syzygy/VERSION' in change.files

#
# Official build scheduler for Syzygy
#
official_scheduler = Scheduler('syzygy_version',
                               treeStableTimer=0,
                               change_filter=ChangeFilter(
                                  filter_fn=_VersionFileFilter),
                               builderNames=['Syzygy Official'])

#
# Windows official Release builder
#
official_factory = win().SyzygyFactory(official_release=True)

official_builder = {
    'name': 'Syzygy Official',
    'factory': official_factory,
    'schedulers': 'syzygy_version',
    'auto_reboot': False,
    'category': 'official',
    }


def Update(config, active_master, c):
  c['schedulers'].append(official_scheduler)
  c['builders'].append(official_builder)

## Instruction:
Fix pylint presubmit check, related to buildbot 0.8.x vs 0.7.x
## Code After:

from buildbot.scheduler import Scheduler
# This is due to buildbot 0.7.12 being used for the presubmit check.
from buildbot.changes.filter import ChangeFilter  # pylint: disable=E0611,F0401

from master.factory import syzygy_factory


def win():
  return syzygy_factory.SyzygyFactory('src/syzygy',
                                      target_platform='win32')


def _VersionFileFilter(change):
  """A change filter function that disregards all changes that don't
  touch src/syzygy/VERSION.

  Args:
      change: a buildbot Change object.
  """
  return change.branch == 'trunk' and 'syzygy/VERSION' in change.files

#
# Official build scheduler for Syzygy
#
official_scheduler = Scheduler('syzygy_version',
                               treeStableTimer=0,
                               change_filter=ChangeFilter(
                                  filter_fn=_VersionFileFilter),
                               builderNames=['Syzygy Official'])

#
# Windows official Release builder
#
official_factory = win().SyzygyFactory(official_release=True)

official_builder = {
    'name': 'Syzygy Official',
    'factory': official_factory,
    'schedulers': 'syzygy_version',
    'auto_reboot': False,
    'category': 'official',
    }


def Update(config, active_master, c):
  c['schedulers'].append(official_scheduler)
  c['builders'].append(official_builder)
