public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/, catalyst/targets/
@ 2015-10-06 13:46 Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2015-10-06 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     bca7ce72c65492f41467f540fba6dee0250d73d6
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  6 03:56:00 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct  6 03:56:00 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=bca7ce72

lint: clean up unused imports

Delete imports that the modules don't actually utilize.

 catalyst/base/resume.py           | 2 --
 catalyst/fileops.py               | 2 ++
 catalyst/targets/grp.py           | 3 +--
 catalyst/targets/livecd_stage1.py | 3 +--
 catalyst/targets/livecd_stage2.py | 3 +--
 catalyst/targets/netboot2.py      | 3 +--
 6 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py
index a03adf3..608f574 100644
--- a/catalyst/base/resume.py
+++ b/catalyst/base/resume.py
@@ -12,8 +12,6 @@ set, unset, is_set, is_unset, enabled, clear_all
 '''
 
 import os
-import shutil
-from stat import ST_UID, ST_GID, ST_MODE
 import sys
 import traceback
 

diff --git a/catalyst/fileops.py b/catalyst/fileops.py
index 129d967..8a05985 100644
--- a/catalyst/fileops.py
+++ b/catalyst/fileops.py
@@ -16,8 +16,10 @@ from stat import ST_UID, ST_GID, ST_MODE
 
 # NOTE: pjoin and listdir_files are imported here for export
 # to other catalyst modules
+# pylint: disable=unused-import
 from snakeoil.osutils import (ensure_dirs as snakeoil_ensure_dirs,
 	pjoin, listdir_files)
+# pylint: enable=unused-import
 from catalyst.support import CatalystError
 
 

diff --git a/catalyst/targets/grp.py b/catalyst/targets/grp.py
index 5a10fff..4814ac6 100644
--- a/catalyst/targets/grp.py
+++ b/catalyst/targets/grp.py
@@ -8,8 +8,7 @@ import types
 import glob
 
 
-from catalyst.support import (CatalystError, normpath,
-	touch, cmd, list_bashify)
+from catalyst.support import (CatalystError, normpath, cmd, list_bashify)
 from catalyst.fileops import ensure_dirs
 from catalyst.base.stagebase import StageBase
 

diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py
index a85eb50..ff320c0 100644
--- a/catalyst/targets/livecd_stage1.py
+++ b/catalyst/targets/livecd_stage1.py
@@ -7,8 +7,7 @@ import os
 import types
 
 
-from catalyst.support import (normpath,
-	touch, cmd)
+from catalyst.support import (normpath, cmd)
 from catalyst.fileops import ensure_dirs
 
 from catalyst.base.stagebase import StageBase

diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
index 77c6613..870dcf9 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -5,8 +5,7 @@ LiveCD stage2 target, builds upon previous LiveCD stage1 tarball
 
 import os
 
-from catalyst.support import (normpath, file_locate, CatalystError, cmd,
-	read_from_clst, touch)
+from catalyst.support import (normpath, file_locate, CatalystError, cmd)
 from catalyst.fileops import ensure_dirs
 from catalyst.base.stagebase import StageBase
 

diff --git a/catalyst/targets/netboot2.py b/catalyst/targets/netboot2.py
index 3305a2a..5de1a74 100644
--- a/catalyst/targets/netboot2.py
+++ b/catalyst/targets/netboot2.py
@@ -8,8 +8,7 @@ import types
 import shutil
 from stat import ST_UID, ST_GID, ST_MODE
 
-from catalyst.support import (CatalystError, normpath,
-	touch, cmd, list_bashify)
+from catalyst.support import (CatalystError, normpath, cmd, list_bashify)
 from catalyst.fileops import ensure_dirs
 
 from catalyst.base.stagebase import StageBase


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/, catalyst/targets/
@ 2015-10-06 13:46 Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2015-10-06 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     179ea5ec7b0914d8ddc81649c8d711322e0dbcd3
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  6 03:40:31 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct  6 03:40:31 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=179ea5ec

lint: drop use of deprecated string module

Replace string.join() with ' '.join() and string.replace(var, ...) with
var.replace(...) as the string module is deprecated.  No real functional
changes here otherwise.

 catalyst/base/stagebase.py        | 33 ++++++++++++++++-----------------
 catalyst/support.py               |  8 ++++----
 catalyst/targets/livecd_stage1.py |  3 +--
 3 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 8a7456e..432ad5c 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1,6 +1,5 @@
 
 import os
-import string
 import imp
 import types
 import shutil
@@ -312,7 +311,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		if "install_mask" in self.settings:
 			if type(self.settings["install_mask"])!=types.StringType:
 				self.settings["install_mask"]=\
-					string.join(self.settings["install_mask"])
+					' '.join(self.settings["install_mask"])
 
 	def set_spec_prefix(self):
 		self.settings["spec_prefix"]=self.settings["target"]
@@ -596,7 +595,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 				self.settings["portage_overlay"]=\
 					self.settings["portage_overlay"].split()
 			print "portage_overlay directories are set to: \""+\
-				string.join(self.settings["portage_overlay"])+"\""
+				' '.join(self.settings["portage_overlay"])+"\""
 
 	def set_overlay(self):
 		if self.settings["spec_prefix"]+"/overlay" in self.settings:
@@ -1134,7 +1133,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 			if myusevars:
 				myf.write("# These are the USE and USE_EXPAND flags that were used for\n# building in addition to what is provided by the profile.\n")
 				myusevars = sorted(set(myusevars))
-				myf.write('USE="'+string.join(myusevars)+'"\n')
+				myf.write('USE="' + ' '.join(myusevars) + '"\n')
 				if '-*' in myusevars:
 					print "\nWarning!!!  "
 					print "\tThe use of -* in "+self.settings["spec_prefix"]+\
@@ -1148,7 +1147,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 
 			if myuseexpandvars:
 				for hostuseexpand in myuseexpandvars:
-					myf.write(hostuseexpand+'="'+string.join(myuseexpandvars[hostuseexpand])+'"\n')
+					myf.write(hostuseexpand + '="' + ' '.join(myuseexpandvars[hostuseexpand]) + '"\n')
 
 			myf.write('PORTDIR="%s"\n' % self.settings['portdir'])
 			myf.write('DISTDIR="%s"\n' % self.settings['distdir'])
@@ -1354,16 +1353,16 @@ class StageBase(TargetBase, ClearBase, GenBase):
 					self.env['clst_' + opt.upper()] = "true"
 				continue
 			""" Sanitize var names by doing "s|/-.|_|g" """
-			varname="clst_"+string.replace(x,"/","_")
-			varname=string.replace(varname,"-","_")
-			varname=string.replace(varname,".","_")
+			varname = "clst_" + x.replace("/", "_")
+			varname = varname.replace("-", "_")
+			varname = varname.replace(".", "_")
 			if type(self.settings[x])==types.StringType:
 				""" Prefix to prevent namespace clashes """
 				#os.environ[varname]=self.settings[x]
 				self.env[varname]=self.settings[x]
 			elif type(self.settings[x])==types.ListType:
-				#os.environ[varname]=string.join(self.settings[x])
-				self.env[varname]=string.join(self.settings[x])
+				#os.environ[varname] = ' '.join(self.settings[x])
+				self.env[varname] = ' '.join(self.settings[x])
 			elif type(self.settings[x])==types.BooleanType:
 				if self.settings[x]:
 					self.env[varname] = "true"
@@ -1377,15 +1376,15 @@ class StageBase(TargetBase, ClearBase, GenBase):
 				if x in ["compress_definitions",
 					"decompress_definitions"]:
 					continue
-				self.env[varname] = string.join(self.settings[x].keys())
+				self.env[varname] = ' '.join(self.settings[x].keys())
 				for y in self.settings[x].keys():
-					varname2 = "clst_"+string.replace(y,"/","_")
-					varname2 = string.replace(varname2,"-","_")
-					varname2 = string.replace(varname2,".","_")
+					varname2 = "clst_" + y.replace("/", "_")
+					varname2 = varname2.replace("-", "_")
+					varname2 = varname2.replace(".", "_")
 					if type(self.settings[x][y]) == types.StringType:
 						self.env[varname2] = self.settings[x][y]
 					elif type(self.settings[x][y]) == types.ListType:
-						self.env[varname2] = string.join(self.settings[x][y])
+						self.env[varname2] = ' '.join(self.settings[x][y])
 					elif type(self.settings[x][y]) == types.BooleanType:
 						if self.settings[x][y]:
 							self.env[varname] = "true"
@@ -1464,7 +1463,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 					things like "<" to remain intact
 					"""
 					myunmerge[x]="'"+myunmerge[x]+"'"
-				myunmerge=string.join(myunmerge)
+				myunmerge = ' '.join(myunmerge)
 
 				""" Before cleaning, unmerge stuff """
 				try:
@@ -1588,7 +1587,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 				"/kernelopts"]
 
 			if type(myopts) != types.StringType:
-				myopts = string.join(myopts)
+				myopts = ' '.join(myopts)
 				self.env[kname+"_kernelopts"]=myopts
 
 			else:

diff --git a/catalyst/support.py b/catalyst/support.py
index 78942a7..5563a15 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -1,7 +1,7 @@
 
 import glob
 import sys
-import string
+import string  # pylint: disable=deprecated-module
 import os
 import types
 import re
@@ -52,7 +52,7 @@ def read_from_clst(file):
 		return -1
 		#raise CatalystError("Could not open file "+file)
 	for line in myf.readlines():
-		#line = string.replace(line, "\n", "") # drop newline
+		#line = line.replace("\n", "") # drop newline
 		myline = myline + line
 	myf.close()
 	return myline
@@ -67,7 +67,7 @@ def list_bashify(mylist):
 		# surround args with quotes for passing to bash,
 		# allows things like "<" to remain intact
 		mypack[x]="'"+mypack[x]+"'"
-	mypack=string.join(mypack)
+	mypack = ' '.join(mypack)
 	return mypack
 
 
@@ -80,7 +80,7 @@ def list_to_string(mylist):
 		# surround args with quotes for passing to bash,
 		# allows things like "<" to remain intact
 		mypack[x]=mypack[x]
-	mypack=string.join(mypack)
+	mypack = ' '.join(mypack)
 	return mypack
 
 

diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py
index d5645e8..a85eb50 100644
--- a/catalyst/targets/livecd_stage1.py
+++ b/catalyst/targets/livecd_stage1.py
@@ -5,7 +5,6 @@ LiveCD stage1 target
 
 import os
 import types
-import string
 
 
 from catalyst.support import (normpath,
@@ -70,6 +69,6 @@ class livecd_stage1(StageBase):
 	def set_pkgcache_path(self):
 		if "pkgcache_path" in self.settings:
 			if type(self.settings["pkgcache_path"]) != types.StringType:
-				self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
+				self.settings["pkgcache_path"] = normpath(' '.join(self.settings["pkgcache_path"]))
 		else:
 			StageBase.set_pkgcache_path(self)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-06 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 13:46 [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/, catalyst/targets/ Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2015-10-06 13:46 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox