Gentoo Archives: gentoo-portage-dev

From: Aaron Bauman <bman@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Aaron Bauman <bman@g.o>
Subject: [gentoo-portage-dev] [PATCH 36/68] lib/portage/env/loaders.py: fix whitespace
Date: Mon, 03 Aug 2020 22:45:38
Message-Id: 20200803224327.1593726-36-bman@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 01/68] lib/portage/util/_dyn_libs/PreservedLibsRegistry.py: fix whitespace by Aaron Bauman
1 Signed-off-by: Aaron Bauman <bman@g.o>
2 ---
3 lib/portage/env/loaders.py | 22 +++++++++++-----------
4 1 file changed, 11 insertions(+), 11 deletions(-)
5
6 diff --git a/lib/portage/env/loaders.py b/lib/portage/env/loaders.py
7 index 5fa5452af..d24e6a47e 100644
8 --- a/lib/portage/env/loaders.py
9 +++ b/lib/portage/env/loaders.py
10 @@ -1,5 +1,5 @@
11 # config.py -- Portage Config
12 -# Copyright 2007-2013 Gentoo Foundation
13 +# Copyright 2007-2020 Gentoo Authors
14 # Distributed under the terms of the GNU General Public License v2
15
16 import errno
17 @@ -16,7 +16,7 @@ from portage import _unicode_encode
18 from portage.localization import _
19
20 class LoaderError(Exception):
21 -
22 +
23 def __init__(self, resource, error_msg):
24 """
25 @param resource: Resource that failed to load (file/sql/etc)
26 @@ -27,7 +27,7 @@ class LoaderError(Exception):
27
28 self.resource = resource
29 self.error_msg = error_msg
30 -
31 +
32 def __str__(self):
33 return "Failed while loading resource: %s, error was: %s" % (
34 self.resource, self.error_msg)
35 @@ -38,7 +38,7 @@ def RecursiveFileLoader(filename):
36 If filename is of type file, return a generate that yields filename
37 else if filename is of type directory, return a generator that fields
38 files in that directory.
39 -
40 +
41 Ignore files beginning with . or ending in ~.
42 Prune CVS directories.
43
44 @@ -117,7 +117,7 @@ class TestTextLoader(DataLoader):
45
46 def setErrors(self, errors):
47 self.errors = errors
48 -
49 +
50 def load(self):
51 return (self.data, self.errors)
52
53 @@ -139,7 +139,7 @@ class FileLoader(DataLoader):
54 Return the {source: {key: value}} pairs from a file
55 Return the {source: [list of errors] from a load
56
57 - @param recursive: If set and self.fname is a directory;
58 + @param recursive: If set and self.fname is a directory;
59 load all files in self.fname
60 @type: Boolean
61 @rtype: tuple
62 @@ -186,12 +186,12 @@ class FileLoader(DataLoader):
63 class ItemFileLoader(FileLoader):
64 """
65 Class to load data from a file full of items one per line
66 -
67 +
68 >>> item1
69 >>> item2
70 >>> item3
71 >>> item1
72 -
73 +
74 becomes { 'item1':None, 'item2':None, 'item3':None }
75 Note that due to the data store being a dict, duplicates
76 are removed.
77 @@ -199,7 +199,7 @@ class ItemFileLoader(FileLoader):
78
79 def __init__(self, filename, validator):
80 FileLoader.__init__(self, filename, validator)
81 -
82 +
83 def lineParser(self, line, line_num, data, errors):
84 line = line.strip()
85 if line.startswith('#'): # Skip commented lines
86 @@ -223,7 +223,7 @@ class ItemFileLoader(FileLoader):
87 class KeyListFileLoader(FileLoader):
88 """
89 Class to load data from a file full of key [list] tuples
90 -
91 +
92 >>>>key foo1 foo2 foo3
93 becomes
94 {'key':['foo1','foo2','foo3']}
95 @@ -274,7 +274,7 @@ class KeyListFileLoader(FileLoader):
96 class KeyValuePairFileLoader(FileLoader):
97 """
98 Class to load data from a file full of key=value pairs
99 -
100 +
101 >>>>key=value
102 >>>>foo=bar
103 becomes:
104 --
105 2.28.0