run pylint3 and fixed report

This commit adds a pylint configuration and fixed all found issues.

Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
Claudius Heine
2017-06-21 13:32:56 +02:00
committed by Daniel Wagner
parent 6bc8e08459
commit 33a21c8d0d
13 changed files with 917 additions and 184 deletions

View File

@@ -19,6 +19,9 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""
This module contains the Repo class.
"""
import os
from urllib.parse import urlparse
@@ -28,6 +31,10 @@ __copyright__ = 'Copyright (c) Siemens AG, 2017'
class Repo:
"""
Represents a repository in the kas configuration.
"""
def __init__(self, url, path, refspec=None, sublayers=None):
self.url = url
self.path = path
@@ -37,6 +44,9 @@ class Repo:
self.git_operation_disabled = False
def disable_git_operations(self):
"""
Disabled all git operation for this repository.
"""
self.git_operation_disabled = True
def __getattr__(self, item):
@@ -47,11 +57,12 @@ class Repo:
return [self.path + '/' + l for l in self.sublayers]
elif item == 'qualified_name':
url = urlparse(self.url)
return ('{url.netloc}{url.path}'.format(url=url)
.replace('@', '.')
.replace(':', '.')
.replace('/', '.')
.replace('*', '.'))
return ('{url.netloc}{url.path}'
.format(url=url)
.replace('@', '.')
.replace(':', '.')
.replace('/', '.')
.replace('*', '.'))
def __str__(self):
return '%s:%s %s' % (self.url, self.refspec, self.sublayers)