buildframework/helium/sf/python/pythoncore/lib/integration/quality.py
author wbernard
Fri, 13 Aug 2010 14:59:05 +0300
changeset 628 7c4a911dc066
parent 588 c7c26511138f
child 645 b8d81fa19e7d
permissions -rw-r--r--
helium_11.0.0-e00f171ca185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     1
#============================================================================ 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     2
#Name        : quality.py 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     3
#Part of     : Helium 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     4
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     5
#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     6
#All rights reserved.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     7
#This component and the accompanying materials are made available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     8
#under the terms of the License "Eclipse Public License v1.0"
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
     9
#which accompanies this distribution, and is available
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    10
#at the URL "http://www.eclipse.org/legal/epl-v10.html".
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    11
#
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    12
#Initial Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    13
#Nokia Corporation - initial contribution.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    14
#
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    15
#Contributors:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    16
#
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    17
#Description:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    18
#===============================================================================
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    19
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    20
"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    21
Symbian log based analyser.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    22
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    23
 * Internal export parser
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    24
 * Duplicate generation parser (relying on abld -what)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    25
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    26
Policy validation.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    27
"""
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    28
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    29
import symbian.log
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    30
import re
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    31
import os
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    32
import csv
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    33
import fileutils
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    34
import pathaddition.match
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    35
import logging
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    36
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    37
#logging.basicConfig(level=logging.DEBUG)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    38
_logger = logging.getLogger("integration.quality")
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    39
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    40
class InternalExportParser(symbian.log.Parser):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    41
    """ This class extends the Symbian log parser class and implement
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    42
        an "abld -what" analyser which detects file generated/exported inside
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    43
        the source tree.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    44
    """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    45
    def __init__(self, _file):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    46
        """The constructor """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    47
        symbian.log.Parser.__init__(self, _file)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    48
        self.__match_what = re.compile("abld(\.bat)?(\s+.*)*\s+-(check)?w(hat)?", re.I)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    49
        self.internalexports = {}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    50
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    51
    def task(self, name, _cmd, _dir, content):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    52
        """ Analyse task log. """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    53
        if self.__match_what.match(_cmd) != None:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    54
            for line in content.splitlines():
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    55
                if line.startswith(os.path.sep) \
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    56
                    and not os.path.normpath(line.strip().lower()).startswith(os.path.sep+"epoc32"+os.path.sep) \
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    57
                    and os.path.splitext(line.strip().lower())[1] != '':
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    58
                    if name not in self.internalexports:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    59
                        self.internalexports[name] = []
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    60
                    self.internalexports[name].append(line)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    61
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    62
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    63
class AbldWhatParser(symbian.log.Parser):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    64
    """ This class extends the Symbian log parser class and implement
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    65
        an "abld -what" analyser which sort the generated files by component. 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    66
    """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    67
    def __init__(self, _file):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    68
        """The constructor """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    69
        symbian.log.Parser.__init__(self, _file)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    70
        self.__match_what = re.compile(r"abld(\.bat)?(\s+.*)*\s+-(check)?w(hat)?", re.I)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    71
        self.__match_cmaker_what = re.compile(r"cmaker(\.cmd)?(\s+.*)*\s+ACTION=what", re.I)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    72
        self.files_per_component = {}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    73
        self.components_per_file = {}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    74
        
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    75
    def task(self, name, _cmd, _dir, content):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    76
        """ Analyse task log. """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    77
        if _cmd != None and self.__match_what.match(_cmd) != None:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    78
            for line in content.splitlines():
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    79
                line = line.strip()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    80
                if not os.path.normpath(line).startswith(os.path.sep):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    81
                    continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    82
                # component per file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    83
                if line.lower() not in self.components_per_file:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    84
                    self.components_per_file[line.lower()] = []
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    85
                if name not in self.components_per_file[line.lower()]:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    86
                    self.components_per_file[line.lower()].append(name)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    87
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    88
                # file per components
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    89
                if name not in self.files_per_component:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    90
                    self.files_per_component[name] = []
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    91
                self.files_per_component[name].append(line)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    92
        elif _cmd != None and self.__match_cmaker_what.match(_cmd) != None:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    93
            for line in content.splitlines():
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    94
                line = line.strip()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    95
                if not line.startswith('"'):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    96
                    continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    97
                if not line.endswith('"'):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    98
                    continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
    99
                line = os.path.normpath(line.strip('"')).lower()
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   100
                # component per file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   101
                if line not in self.components_per_file:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   102
                    self.components_per_file[line] = []
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   103
                if name not in self.components_per_file[line]:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   104
                    self.components_per_file[line].append(name)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   105
            
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   106
                # file per components
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   107
                if name not in self.files_per_component:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   108
                    self.files_per_component[name] = []
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   109
                self.files_per_component[name].append(line)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   110
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   111
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   112
class PolicyValidator(object):
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   113
    """ Validate policy files on a hierarchy. """
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   114
    def __init__(self, policyfiles=None, csvfile=None, ignoreroot=False, excludes=None):
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   115
        """The constructor """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   116
        if policyfiles is None:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   117
            policyfiles = ['distribution.policy.s60']
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   118
        self._policyfiles = policyfiles
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   119
        self._ids = None
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   120
        self._ignoreroot = ignoreroot
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   121
        
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   122
        if not excludes:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   123
            self._excludes = []
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   124
        else:
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   125
            self._excludes = excludes
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   126
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   127
    def load_policy_ids(self, csvfile):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   128
        """ Load the icds from the CSV file.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   129
            report format by generating array: ['unknownstatus', value, description]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   130
        """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   131
        self._ids = {}
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   132
        reader = csv.reader(open(csvfile, "rU"))
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   133
        for row in reader:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   134
            if len(row)>=3 and re.match(r"^\s*\d+\s*$", row[0]): 
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   135
                self._ids[row[0]] = row
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   136
                if row[1].lower() != "yes" and row[1].lower() != "no" and row[1].lower() != "bin":
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   137
                    yield ["unknownstatus", row[0], row[2]]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   138
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   139
    def validate_content(self, filename):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   140
        """  Validating the policy file content. If it cannot be decoded, 
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   141
            it reports an 'invalidencoding'.
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   142
            Case 'notinidlist': value is not defined under the id list.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   143
        """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   144
        value = None
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   145
        try:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   146
            value = fileutils.read_policy_content(filename)
628
7c4a911dc066 helium_11.0.0-e00f171ca185
wbernard
parents: 588
diff changeset
   147
        except IOError:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   148
            yield ["invalidencoding", filename, None]
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   149
        if value is not None:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   150
            if self._ids != None:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   151
                if value not in self._ids:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   152
                    yield ["notinidlist", filename, value]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   153
    
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   154
    def find_policy(self, path):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   155
        """ find the policy file under path using filenames under the list. """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   156
        for filename in self._policyfiles:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   157
            if os.sep != '\\':
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   158
                for f_file in os.listdir(path):
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   159
                    if f_file.lower() == filename.lower():
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   160
                        return os.path.join(path, f_file)
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   161
            if os.path.exists(os.path.join(path, filename)):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   162
                return os.path.join(path, filename)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   163
        return None
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   164
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   165
    def validate(self, path):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   166
        """ Return a list couple [errortype, location, policy].
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   167
            errortype: missing, invalidencoding, notinidlist .
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   168
            missing: location is a directory.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   169
            otherwise the doggie policy file.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   170
        """
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   171
        path = os.path.normpath(path)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   172
        for dirpath, _, _ in os.walk(path):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   173
            # skipping the root
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   174
            if dirpath == path and self._ignoreroot:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   175
                continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   176
            # skip .svn and .hg dirs
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   177
            if pathaddition.match.ant_match(dirpath, "**/.svn/**"):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   178
                continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   179
            if pathaddition.match.ant_match(dirpath, "**/.hg/**"):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   180
                continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   181
            # Skipping j2me content. Shouln't this be done differently?
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   182
            if pathaddition.match.ant_match(dirpath, "**/j2me/**"):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   183
                continue
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   184
            filename = self.find_policy(dirpath)
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   185
            if filename != None:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   186
                for result in self.validate_content(filename):
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   187
                    yield result
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   188
            else:
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   189
                # report an error is the directory has no DP file
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   190
                # and any files underneith.
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   191
                for item in os.listdir(dirpath):
588
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   192
                    if os.path.isfile(os.path.join(dirpath, item)) \
c7c26511138f helium-10.0.0-bc45d50958fe
wbernard
parents: 587
diff changeset
   193
                        and item not in self._excludes:
587
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   194
                        yield ['missing', dirpath, None]
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   195
                        break
85df38eb4012 helium_9.0-a7879c935424
wbernard
parents:
diff changeset
   196