From 58bd2a948ecf3089ac3a1ea47888748a8b6693bb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 25 Feb 2017 20:49:07 -0800 Subject: PEP-8 fixes --- src/engine/SCons/SConsign.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/engine/SCons/SConsign.py b/src/engine/SCons/SConsign.py index 75d2c41..3bd4b71 100644 --- a/src/engine/SCons/SConsign.py +++ b/src/engine/SCons/SConsign.py @@ -41,6 +41,7 @@ import SCons.Warnings from SCons.compat import PICKLE_PROTOCOL + def corrupt_dblite_warning(filename): SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, "Ignoring corrupt .sconsign file: %s"%filename) @@ -48,7 +49,7 @@ def corrupt_dblite_warning(filename): SCons.dblite.ignore_corrupt_dbfiles = 1 SCons.dblite.corruption_warning = corrupt_dblite_warning -#XXX Get rid of the global array so this becomes re-entrant. +# XXX Get rid of the global array so this becomes re-entrant. sig_files = [] # Info for the database SConsign implementation (now the default): @@ -62,6 +63,7 @@ DB_Module = SCons.dblite DB_Name = ".sconsign" DB_sync_list = [] + def Get_DataBase(dir): global DataBase, DB_Module, DB_Name top = dir.fs.Top @@ -90,6 +92,7 @@ def Get_DataBase(dir): print("DataBase =", DataBase) raise + def Reset(): """Reset global state. Used by unit tests that end up using SConsign multiple times to get a clean slate for each test.""" @@ -99,6 +102,7 @@ def Reset(): normcase = os.path.normcase + def write(): global sig_files for sig_file in sig_files: @@ -117,6 +121,7 @@ def write(): else: closemethod() + class SConsignEntry(object): """ Wrapper class for the generic entry in a .sconsign file. @@ -159,6 +164,7 @@ class SConsignEntry(object): if key not in ('_version_id','__weakref__'): setattr(self, key, value) + class Base(object): """ This is the controlling class for the signatures for the collection of @@ -213,6 +219,7 @@ class Base(object): self.entries[key] = entry self.to_be_merged = {} + class DB(Base): """ A Base subclass that reads and writes signature information @@ -285,6 +292,7 @@ class DB(Base): else: syncmethod() + class Dir(Base): def __init__(self, fp=None, dir=None): """ @@ -304,6 +312,7 @@ class Dir(Base): for key, entry in list(self.entries.items()): entry.convert_from_sconsign(dir, key) + class DirFile(Dir): """ Encapsulates reading and writing a per-directory .sconsign file. @@ -394,6 +403,7 @@ class DirFile(Dir): ForDirectory = DB + def File(name, dbm_module=None): """ Arrange for all signatures to be stored in a global .sconsign.db* -- cgit v0.12