mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:39:02 +02:00
bitbake: lib: Remove double imports
* Remove double imports mentioned by pylint (Bitbake rev: 741db6719efca5aa9ef2c15e60cdd624e4aa1a8d) Signed-off-by: Michael Estner <michaelestner@web.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
ff8898d10b
commit
e1836b205a
|
@ -194,7 +194,6 @@ def deprecated(func, name=None, advice=""):
|
||||||
# For compatibility
|
# For compatibility
|
||||||
def deprecate_import(current, modulename, fromlist, renames = None):
|
def deprecate_import(current, modulename, fromlist, renames = None):
|
||||||
"""Import objects from one module into another, wrapping them with a DeprecationWarning"""
|
"""Import objects from one module into another, wrapping them with a DeprecationWarning"""
|
||||||
import sys
|
|
||||||
|
|
||||||
module = __import__(modulename, fromlist = fromlist)
|
module = __import__(modulename, fromlist = fromlist)
|
||||||
for position, objname in enumerate(fromlist):
|
for position, objname in enumerate(fromlist):
|
||||||
|
|
|
@ -195,8 +195,6 @@ class ACL(object):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
import argparse
|
import argparse
|
||||||
import pwd
|
|
||||||
import grp
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|
|
@ -817,7 +817,6 @@ class Git(FetchMethod):
|
||||||
"""
|
"""
|
||||||
Return True if git-lfs can be found, False otherwise.
|
Return True if git-lfs can be found, False otherwise.
|
||||||
"""
|
"""
|
||||||
import shutil
|
|
||||||
return shutil.which("git-lfs", path=d.getVar('PATH')) is not None
|
return shutil.which("git-lfs", path=d.getVar('PATH')) is not None
|
||||||
|
|
||||||
def _get_repo_url(self, ud):
|
def _get_repo_url(self, ud):
|
||||||
|
|
|
@ -264,7 +264,7 @@ class GitSM(Git):
|
||||||
Git.clean(self, ud, d)
|
Git.clean(self, ud, d)
|
||||||
|
|
||||||
def implicit_urldata(self, ud, d):
|
def implicit_urldata(self, ud, d):
|
||||||
import shutil, subprocess, tempfile
|
import subprocess
|
||||||
|
|
||||||
urldata = []
|
urldata = []
|
||||||
def add_submodule(ud, url, module, modpath, workdir, d):
|
def add_submodule(ud, url, module, modpath, workdir, d):
|
||||||
|
|
|
@ -477,7 +477,6 @@ class RunQueueData:
|
||||||
self.runtaskentries = {}
|
self.runtaskentries = {}
|
||||||
|
|
||||||
def runq_depends_names(self, ids):
|
def runq_depends_names(self, ids):
|
||||||
import re
|
|
||||||
ret = []
|
ret = []
|
||||||
for id in ids:
|
for id in ids:
|
||||||
nam = os.path.basename(id)
|
nam = os.path.basename(id)
|
||||||
|
|
|
@ -835,6 +835,5 @@ class FeatureNotFound(ValueError):
|
||||||
|
|
||||||
#If this file is run as a script, act as an HTML pretty-printer.
|
#If this file is run as a script, act as an HTML pretty-printer.
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
|
||||||
soup = BeautifulSoup(sys.stdin)
|
soup = BeautifulSoup(sys.stdin)
|
||||||
print((soup.prettify()))
|
print((soup.prettify()))
|
||||||
|
|
|
@ -17,7 +17,6 @@ import tempfile
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
import sys
|
import sys
|
||||||
import cProfile
|
|
||||||
|
|
||||||
def diagnose(data):
|
def diagnose(data):
|
||||||
"""Diagnostic suite for isolating common problems.
|
"""Diagnostic suite for isolating common problems.
|
||||||
|
|
|
@ -1122,7 +1122,6 @@ class LRParser:
|
||||||
# manipulate the rules that make up a grammar.
|
# manipulate the rules that make up a grammar.
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
# regex matching identifiers
|
# regex matching identifiers
|
||||||
_is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$')
|
_is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$')
|
||||||
|
|
|
@ -79,7 +79,6 @@ if 'sqlite' in settings.DATABASES['default']['ENGINE']:
|
||||||
# end of HACK
|
# end of HACK
|
||||||
|
|
||||||
class GitURLValidator(validators.URLValidator):
|
class GitURLValidator(validators.URLValidator):
|
||||||
import re
|
|
||||||
regex = re.compile(
|
regex = re.compile(
|
||||||
r'^(?:ssh|git|http|ftp)s?://' # http:// or https://
|
r'^(?:ssh|git|http|ftp)s?://' # http:// or https://
|
||||||
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain...
|
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain...
|
||||||
|
@ -1500,7 +1499,7 @@ class Layer_Version(models.Model):
|
||||||
# code lifted, with adaptations, from the layerindex-web application
|
# code lifted, with adaptations, from the layerindex-web application
|
||||||
# https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
|
# https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
|
||||||
def _handle_url_path(self, base_url, path):
|
def _handle_url_path(self, base_url, path):
|
||||||
import re, posixpath
|
import posixpath
|
||||||
if base_url:
|
if base_url:
|
||||||
if self.dirpath:
|
if self.dirpath:
|
||||||
if path:
|
if path:
|
||||||
|
|
|
@ -233,7 +233,6 @@ def filter_sizeovertotal(package_object, total_size):
|
||||||
|
|
||||||
return '{:.1%}'.format(float(size)/float(total_size))
|
return '{:.1%}'.format(float(size)/float(total_size))
|
||||||
|
|
||||||
from django.utils.safestring import mark_safe
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def format_vpackage_rowclass(size):
|
def format_vpackage_rowclass(size):
|
||||||
if size == -1:
|
if size == -1:
|
||||||
|
|
|
@ -372,7 +372,6 @@ def _get_parameters_values(request, default_count, default_order):
|
||||||
# set cookies for parameters. this is usefull in case parameters are set
|
# set cookies for parameters. this is usefull in case parameters are set
|
||||||
# manually from the GET values of the link
|
# manually from the GET values of the link
|
||||||
def _set_parameters_values(pagesize, orderby, request):
|
def _set_parameters_values(pagesize, orderby, request):
|
||||||
from django.urls import resolve
|
|
||||||
current_url = resolve(request.path_info).url_name
|
current_url = resolve(request.path_info).url_name
|
||||||
request.session['%s_count' % current_url] = pagesize
|
request.session['%s_count' % current_url] = pagesize
|
||||||
request.session['%s_orderby' % current_url] =orderby
|
request.session['%s_orderby' % current_url] =orderby
|
||||||
|
@ -699,7 +698,6 @@ class LazyEncoder(json.JSONEncoder):
|
||||||
return super(LazyEncoder, self).default(obj)
|
return super(LazyEncoder, self).default(obj)
|
||||||
|
|
||||||
from toastergui.templatetags.projecttags import filtered_filesizeformat
|
from toastergui.templatetags.projecttags import filtered_filesizeformat
|
||||||
import os
|
|
||||||
def _get_dir_entries(build_id, target_id, start):
|
def _get_dir_entries(build_id, target_id, start):
|
||||||
node_str = {
|
node_str = {
|
||||||
Target_File.ITYPE_REGULAR : '-',
|
Target_File.ITYPE_REGULAR : '-',
|
||||||
|
|
|
@ -298,7 +298,6 @@ SOUTH_TESTS_MIGRATE = False
|
||||||
|
|
||||||
# We automatically detect and install applications here if
|
# We automatically detect and install applications here if
|
||||||
# they have a 'models.py' or 'views.py' file
|
# they have a 'models.py' or 'views.py' file
|
||||||
import os
|
|
||||||
currentdir = os.path.dirname(__file__)
|
currentdir = os.path.dirname(__file__)
|
||||||
for t in os.walk(os.path.dirname(currentdir)):
|
for t in os.walk(os.path.dirname(currentdir)):
|
||||||
modulename = os.path.basename(t[0])
|
modulename = os.path.basename(t[0])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user