summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Estner <michaelestner@web.de>2025-02-25 19:34:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-27 15:12:55 +0000
commite1836b205a2716e85f36346762805e2e505a5eb6 (patch)
tree6564a413bf1e3e3e092884871d4cdf49f8cf72d8
parentff8898d10b75841061928da3facac506b281ed81 (diff)
downloadpoky-e1836b205a2716e85f36346762805e2e505a5eb6.tar.gz
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>
-rw-r--r--bitbake/lib/bb/__init__.py1
-rwxr-xr-xbitbake/lib/bb/acl.py2
-rw-r--r--bitbake/lib/bb/fetch2/git.py1
-rw-r--r--bitbake/lib/bb/fetch2/gitsm.py2
-rw-r--r--bitbake/lib/bb/runqueue.py1
-rw-r--r--bitbake/lib/bs4/__init__.py1
-rw-r--r--bitbake/lib/bs4/diagnose.py1
-rw-r--r--bitbake/lib/ply/yacc.py1
-rw-r--r--bitbake/lib/toaster/orm/models.py3
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py1
-rw-r--r--bitbake/lib/toaster/toastergui/views.py2
-rw-r--r--bitbake/lib/toaster/toastermain/settings.py1
12 files changed, 2 insertions, 15 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index 574e0de5be..876f7e3976 100644
--- a/bitbake/lib/bb/__init__.py
+++ b/bitbake/lib/bb/__init__.py
@@ -194,7 +194,6 @@ def deprecated(func, name=None, advice=""):
194# For compatibility 194# For compatibility
195def deprecate_import(current, modulename, fromlist, renames = None): 195def deprecate_import(current, modulename, fromlist, renames = None):
196 """Import objects from one module into another, wrapping them with a DeprecationWarning""" 196 """Import objects from one module into another, wrapping them with a DeprecationWarning"""
197 import sys
198 197
199 module = __import__(modulename, fromlist = fromlist) 198 module = __import__(modulename, fromlist = fromlist)
200 for position, objname in enumerate(fromlist): 199 for position, objname in enumerate(fromlist):
diff --git a/bitbake/lib/bb/acl.py b/bitbake/lib/bb/acl.py
index 0f41b275cf..e9dbdb617f 100755
--- a/bitbake/lib/bb/acl.py
+++ b/bitbake/lib/bb/acl.py
@@ -195,8 +195,6 @@ class ACL(object):
195 195
196def main(): 196def main():
197 import argparse 197 import argparse
198 import pwd
199 import grp
200 from pathlib import Path 198 from pathlib import Path
201 199
202 parser = argparse.ArgumentParser() 200 parser = argparse.ArgumentParser()
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 6badda5972..168f14d0c8 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -817,7 +817,6 @@ class Git(FetchMethod):
817 """ 817 """
818 Return True if git-lfs can be found, False otherwise. 818 Return True if git-lfs can be found, False otherwise.
819 """ 819 """
820 import shutil
821 return shutil.which("git-lfs", path=d.getVar('PATH')) is not None 820 return shutil.which("git-lfs", path=d.getVar('PATH')) is not None
822 821
823 def _get_repo_url(self, ud): 822 def _get_repo_url(self, ud):
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index ba62517f08..bab1bf2580 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -264,7 +264,7 @@ class GitSM(Git):
264 Git.clean(self, ud, d) 264 Git.clean(self, ud, d)
265 265
266 def implicit_urldata(self, ud, d): 266 def implicit_urldata(self, ud, d):
267 import shutil, subprocess, tempfile 267 import subprocess
268 268
269 urldata = [] 269 urldata = []
270 def add_submodule(ud, url, module, modpath, workdir, d): 270 def add_submodule(ud, url, module, modpath, workdir, d):
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index ffb2d28494..ad4ce0b0e2 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -477,7 +477,6 @@ class RunQueueData:
477 self.runtaskentries = {} 477 self.runtaskentries = {}
478 478
479 def runq_depends_names(self, ids): 479 def runq_depends_names(self, ids):
480 import re
481 ret = [] 480 ret = []
482 for id in ids: 481 for id in ids:
483 nam = os.path.basename(id) 482 nam = os.path.basename(id)
diff --git a/bitbake/lib/bs4/__init__.py b/bitbake/lib/bs4/__init__.py
index d8ad5e1dc1..725203d94a 100644
--- a/bitbake/lib/bs4/__init__.py
+++ b/bitbake/lib/bs4/__init__.py
@@ -835,6 +835,5 @@ class FeatureNotFound(ValueError):
835 835
836#If this file is run as a script, act as an HTML pretty-printer. 836#If this file is run as a script, act as an HTML pretty-printer.
837if __name__ == '__main__': 837if __name__ == '__main__':
838 import sys
839 soup = BeautifulSoup(sys.stdin) 838 soup = BeautifulSoup(sys.stdin)
840 print((soup.prettify())) 839 print((soup.prettify()))
diff --git a/bitbake/lib/bs4/diagnose.py b/bitbake/lib/bs4/diagnose.py
index e079772e69..4692795340 100644
--- a/bitbake/lib/bs4/diagnose.py
+++ b/bitbake/lib/bs4/diagnose.py
@@ -17,7 +17,6 @@ import tempfile
17import time 17import time
18import traceback 18import traceback
19import sys 19import sys
20import cProfile
21 20
22def diagnose(data): 21def diagnose(data):
23 """Diagnostic suite for isolating common problems. 22 """Diagnostic suite for isolating common problems.
diff --git a/bitbake/lib/ply/yacc.py b/bitbake/lib/ply/yacc.py
index 381b50cf0b..529f85b081 100644
--- a/bitbake/lib/ply/yacc.py
+++ b/bitbake/lib/ply/yacc.py
@@ -1122,7 +1122,6 @@ class LRParser:
1122# manipulate the rules that make up a grammar. 1122# manipulate the rules that make up a grammar.
1123# ----------------------------------------------------------------------------- 1123# -----------------------------------------------------------------------------
1124 1124
1125import re
1126 1125
1127# regex matching identifiers 1126# regex matching identifiers
1128_is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$') 1127_is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$')
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 19c9686206..e2f488ed89 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -79,7 +79,6 @@ if 'sqlite' in settings.DATABASES['default']['ENGINE']:
79 # end of HACK 79 # end of HACK
80 80
81class GitURLValidator(validators.URLValidator): 81class GitURLValidator(validators.URLValidator):
82 import re
83 regex = re.compile( 82 regex = re.compile(
84 r'^(?:ssh|git|http|ftp)s?://' # http:// or https:// 83 r'^(?:ssh|git|http|ftp)s?://' # http:// or https://
85 r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' # domain... 84 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):
1500 # code lifted, with adaptations, from the layerindex-web application 1499 # code lifted, with adaptations, from the layerindex-web application
1501 # https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/ 1500 # https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
1502 def _handle_url_path(self, base_url, path): 1501 def _handle_url_path(self, base_url, path):
1503 import re, posixpath 1502 import posixpath
1504 if base_url: 1503 if base_url:
1505 if self.dirpath: 1504 if self.dirpath:
1506 if path: 1505 if path:
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index bd398f0012..aee9bbcd14 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -233,7 +233,6 @@ def filter_sizeovertotal(package_object, total_size):
233 233
234 return '{:.1%}'.format(float(size)/float(total_size)) 234 return '{:.1%}'.format(float(size)/float(total_size))
235 235
236from django.utils.safestring import mark_safe
237@register.filter 236@register.filter
238def format_vpackage_rowclass(size): 237def format_vpackage_rowclass(size):
239 if size == -1: 238 if size == -1:
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 40aed265dc..061e6436c8 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -372,7 +372,6 @@ def _get_parameters_values(request, default_count, default_order):
372# set cookies for parameters. this is usefull in case parameters are set 372# set cookies for parameters. this is usefull in case parameters are set
373# manually from the GET values of the link 373# manually from the GET values of the link
374def _set_parameters_values(pagesize, orderby, request): 374def _set_parameters_values(pagesize, orderby, request):
375 from django.urls import resolve
376 current_url = resolve(request.path_info).url_name 375 current_url = resolve(request.path_info).url_name
377 request.session['%s_count' % current_url] = pagesize 376 request.session['%s_count' % current_url] = pagesize
378 request.session['%s_orderby' % current_url] =orderby 377 request.session['%s_orderby' % current_url] =orderby
@@ -699,7 +698,6 @@ class LazyEncoder(json.JSONEncoder):
699 return super(LazyEncoder, self).default(obj) 698 return super(LazyEncoder, self).default(obj)
700 699
701from toastergui.templatetags.projecttags import filtered_filesizeformat 700from toastergui.templatetags.projecttags import filtered_filesizeformat
702import os
703def _get_dir_entries(build_id, target_id, start): 701def _get_dir_entries(build_id, target_id, start):
704 node_str = { 702 node_str = {
705 Target_File.ITYPE_REGULAR : '-', 703 Target_File.ITYPE_REGULAR : '-',
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
index e06adc5a93..d2a449627f 100644
--- a/bitbake/lib/toaster/toastermain/settings.py
+++ b/bitbake/lib/toaster/toastermain/settings.py
@@ -298,7 +298,6 @@ SOUTH_TESTS_MIGRATE = False
298 298
299# We automatically detect and install applications here if 299# We automatically detect and install applications here if
300# they have a 'models.py' or 'views.py' file 300# they have a 'models.py' or 'views.py' file
301import os
302currentdir = os.path.dirname(__file__) 301currentdir = os.path.dirname(__file__)
303for t in os.walk(os.path.dirname(currentdir)): 302for t in os.walk(os.path.dirname(currentdir)):
304 modulename = os.path.basename(t[0]) 303 modulename = os.path.basename(t[0])