diff options
Diffstat (limited to 'external/poky/bitbake/lib/bb/monitordisk.py')
-rw-r--r-- | external/poky/bitbake/lib/bb/monitordisk.py | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/external/poky/bitbake/lib/bb/monitordisk.py b/external/poky/bitbake/lib/bb/monitordisk.py index 833cd3d3..e7c07264 100644 --- a/external/poky/bitbake/lib/bb/monitordisk.py +++ b/external/poky/bitbake/lib/bb/monitordisk.py @@ -1,23 +1,10 @@ -#!/usr/bin/env python -# ex:ts=4:sw=4:sts=4:et -# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2012 Robert Yang # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. +# SPDX-License-Identifier: GPL-2.0-only # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import os, logging, re, sys +import os, logging, re import bb logger = logging.getLogger("BitBake.Monitor") @@ -28,16 +15,16 @@ def convertGMK(unit): """ Convert the space unit G, M, K, the unit is case-insensitive """ - unitG = re.match('([1-9][0-9]*)[gG]\s?$', unit) + unitG = re.match(r'([1-9][0-9]*)[gG]\s?$', unit) if unitG: return int(unitG.group(1)) * (1024 ** 3) - unitM = re.match('([1-9][0-9]*)[mM]\s?$', unit) + unitM = re.match(r'([1-9][0-9]*)[mM]\s?$', unit) if unitM: return int(unitM.group(1)) * (1024 ** 2) - unitK = re.match('([1-9][0-9]*)[kK]\s?$', unit) + unitK = re.match(r'([1-9][0-9]*)[kK]\s?$', unit) if unitK: return int(unitK.group(1)) * 1024 - unitN = re.match('([1-9][0-9]*)\s?$', unit) + unitN = re.match(r'([1-9][0-9]*)\s?$', unit) if unitN: return int(unitN.group(1)) else: @@ -83,7 +70,7 @@ def getDiskData(BBDirs, configuration): for pathSpaceInode in BBDirs.split(): # The input format is: "dir,space,inode", dir is a must, space # and inode are optional - pathSpaceInodeRe = re.match('([^,]*),([^,]*),([^,]*),?(.*)', pathSpaceInode) + pathSpaceInodeRe = re.match(r'([^,]*),([^,]*),([^,]*),?(.*)', pathSpaceInode) if not pathSpaceInodeRe: printErr("Invalid value in BB_DISKMON_DIRS: %s" % pathSpaceInode) return None @@ -147,7 +134,7 @@ def getInterval(configuration): else: # The disk space or inode interval is optional, but it should # have a correct value once it is specified - intervalRe = re.match('([^,]*),?\s*(.*)', interval) + intervalRe = re.match(r'([^,]*),?\s*(.*)', interval) if intervalRe: intervalSpace = intervalRe.group(1) if intervalSpace: |