summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/monitordisk.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-14 15:50:51 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-16 15:35:07 +0000
commite5455662a9762fc2cb8859134d855413d84fd265 (patch)
treead7c3c6b258415ab9b92ed4b04a1ce0c2f6c9eb7 /bitbake/lib/bb/monitordisk.py
parentca4a8eea6284aad41ec67b375c2a7c7855b5fe11 (diff)
downloadpoky-e5455662a9762fc2cb8859134d855413d84fd265.tar.gz
bitbake: bitbake: Fix Deprecated warnings from regexs
Fix handling of escape characters in regexs and hence fix python Deprecation warnings which will be problematic in python 3.8. (Bitbake rev: c1fcc46e2498ddd41425d8756754f814d682aba3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/monitordisk.py')
-rw-r--r--bitbake/lib/bb/monitordisk.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py
index 833cd3d344..2ad1e61562 100644
--- a/bitbake/lib/bb/monitordisk.py
+++ b/bitbake/lib/bb/monitordisk.py
@@ -28,16 +28,16 @@ def convertGMK(unit):
28 28
29 """ Convert the space unit G, M, K, the unit is case-insensitive """ 29 """ Convert the space unit G, M, K, the unit is case-insensitive """
30 30
31 unitG = re.match('([1-9][0-9]*)[gG]\s?$', unit) 31 unitG = re.match(r'([1-9][0-9]*)[gG]\s?$', unit)
32 if unitG: 32 if unitG:
33 return int(unitG.group(1)) * (1024 ** 3) 33 return int(unitG.group(1)) * (1024 ** 3)
34 unitM = re.match('([1-9][0-9]*)[mM]\s?$', unit) 34 unitM = re.match(r'([1-9][0-9]*)[mM]\s?$', unit)
35 if unitM: 35 if unitM:
36 return int(unitM.group(1)) * (1024 ** 2) 36 return int(unitM.group(1)) * (1024 ** 2)
37 unitK = re.match('([1-9][0-9]*)[kK]\s?$', unit) 37 unitK = re.match(r'([1-9][0-9]*)[kK]\s?$', unit)
38 if unitK: 38 if unitK:
39 return int(unitK.group(1)) * 1024 39 return int(unitK.group(1)) * 1024
40 unitN = re.match('([1-9][0-9]*)\s?$', unit) 40 unitN = re.match(r'([1-9][0-9]*)\s?$', unit)
41 if unitN: 41 if unitN:
42 return int(unitN.group(1)) 42 return int(unitN.group(1))
43 else: 43 else:
@@ -83,7 +83,7 @@ def getDiskData(BBDirs, configuration):
83 for pathSpaceInode in BBDirs.split(): 83 for pathSpaceInode in BBDirs.split():
84 # The input format is: "dir,space,inode", dir is a must, space 84 # The input format is: "dir,space,inode", dir is a must, space
85 # and inode are optional 85 # and inode are optional
86 pathSpaceInodeRe = re.match('([^,]*),([^,]*),([^,]*),?(.*)', pathSpaceInode) 86 pathSpaceInodeRe = re.match(r'([^,]*),([^,]*),([^,]*),?(.*)', pathSpaceInode)
87 if not pathSpaceInodeRe: 87 if not pathSpaceInodeRe:
88 printErr("Invalid value in BB_DISKMON_DIRS: %s" % pathSpaceInode) 88 printErr("Invalid value in BB_DISKMON_DIRS: %s" % pathSpaceInode)
89 return None 89 return None
@@ -147,7 +147,7 @@ def getInterval(configuration):
147 else: 147 else:
148 # The disk space or inode interval is optional, but it should 148 # The disk space or inode interval is optional, but it should
149 # have a correct value once it is specified 149 # have a correct value once it is specified
150 intervalRe = re.match('([^,]*),?\s*(.*)', interval) 150 intervalRe = re.match(r'([^,]*),?\s*(.*)', interval)
151 if intervalRe: 151 if intervalRe:
152 intervalSpace = intervalRe.group(1) 152 intervalSpace = intervalRe.group(1)
153 if intervalSpace: 153 if intervalSpace: