# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import fnmatch
import os


def _list_files(folder, pattern):
    """Lists all files below the given folder that match the pattern."""
    for root, folders, files in os.walk(folder):
        for filename in files:
            if fnmatch.fnmatch(filename, pattern):
                yield os.path.join(root, filename)


def session_check_requirements(session):
    """Checks for out of date requirements and optionally updates them."""
    session.install('gcp-devrel-py-tools')

    if 'update' in session.posargs:
        command = 'update-requirements'
    else:
        command = 'check-requirements'

    reqfiles = list(_list_files('.', 'requirements*.txt'))

    for reqfile in reqfiles:
        session.run('gcp-devrel-py-tools', command, reqfile)

7918ba41361d4cd56c03c38c751318722bdc2ac5
<mask token>

<mask token>


def _list_files(folder, pattern):
    """Lists all files below the given folder that match the pattern."""
    for root, folders, files in os.walk(folder):
        for filename in files:
            if fnmatch.fnmatch(filename, pattern):
                yield os.path.join(root, filename)


<mask token>

<mask token>


def _list_files(folder, pattern):
    """Lists all files below the given folder that match the pattern."""
    for root, folders, files in os.walk(folder):
        for filename in files:
            if fnmatch.fnmatch(filename, pattern):
                yield os.path.join(root, filename)


def session_check_requirements(session):
    """Checks for out of date requirements and optionally updates them."""
    session.install('gcp-devrel-py-tools')
    if 'update' in session.posargs:
        command = 'update-requirements'
    else:
        command = 'check-requirements'
    reqfiles = list(_list_files('.', 'requirements*.txt'))
    for reqfile in reqfiles:
        session.run('gcp-devrel-py-tools', command, reqfile)

import fnmatch
import os


def _list_files(folder, pattern):
    """Lists all files below the given folder that match the pattern."""
    for root, folders, files in os.walk(folder):
        for filename in files:
            if fnmatch.fnmatch(filename, pattern):
                yield os.path.join(root, filename)


def session_check_requirements(session):
    """Checks for out of date requirements and optionally updates them."""
    session.install('gcp-devrel-py-tools')
    if 'update' in session.posargs:
        command = 'update-requirements'
    else:
        command = 'check-requirements'
    reqfiles = list(_list_files('.', 'requirements*.txt'))
    for reqfile in reqfiles:
        session.run('gcp-devrel-py-tools', command, reqfile)

# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import fnmatch
import os


def _list_files(folder, pattern):
    """Lists all files below the given folder that match the pattern."""
    for root, folders, files in os.walk(folder):
        for filename in files:
            if fnmatch.fnmatch(filename, pattern):
                yield os.path.join(root, filename)


def session_check_requirements(session):
    """Checks for out of date requirements and optionally updates them."""
    session.install('gcp-devrel-py-tools')

    if 'update' in session.posargs:
        command = 'update-requirements'
    else:
        command = 'check-requirements'

    reqfiles = list(_list_files('.', 'requirements*.txt'))

    for reqfile in reqfiles:
        session.run('gcp-devrel-py-tools', command, reqfile)
