Commits

Anonymous committed 2ed0c96

Move output-related code to SmartLiveRebuild.output submodule.

Comments (0)

Files changed (3)

SmartLiveRebuild/__init__.py

+# (to satisfy package loading)

SmartLiveRebuild/output.py

+import sys
+
+class out:
+	red = '\033[1;31m'
+	green = '\033[32m'
+	lime = '\033[1;32m'
+	yellow = '\033[1;33m'
+	cyan = '\033[36m'
+	turq = '\033[1;36m'
+	white = '\033[1;37m'
+	reset = '\033[0m'
+
+	s1reset = lime
+	s2reset = green
+	s3reset = cyan
+	errreset = yellow
+
+	@classmethod
+	def monochromize(self):
+		for k in dir(self):
+			if not k.startswith('_'):
+				v = getattr(self, k)
+				if isinstance(v, str) and v.startswith('\033'):
+					setattr(self, k, '')
+
+	@classmethod
+	def s1(self, msg):
+		self.out('%s*** %s%s\n' % (self.s1reset, msg, self.reset))
+	@classmethod
+	def s2(self, msg):
+		self.out('%s->%s  %s\n' % (self.s2reset, self.reset, msg))
+	@classmethod
+	def s3(self, msg):
+		self.out('%s-->%s %s\n' % (self.s3reset, self.reset, msg))
+
+	@classmethod
+	def err(self, msg):
+		self.out('%s!!!%s %s%s%s\n' % (self.red, self.reset, self.errreset, msg, self.reset))
+
+	@staticmethod
+	def out(msg):
+		sys.stderr.write(msg)
+
+

smart-live-rebuild

 except ImportError: # py2
 	from ConfigParser import ConfigParser, NoOptionError
 
-class out:
-	red = '\033[1;31m'
-	green = '\033[32m'
-	lime = '\033[1;32m'
-	yellow = '\033[1;33m'
-	cyan = '\033[36m'
-	turq = '\033[1;36m'
-	white = '\033[1;37m'
-	reset = '\033[0m'
-
-	s1reset = lime
-	s2reset = green
-	s3reset = cyan
-	errreset = yellow
-
-	@classmethod
-	def monochromize(self):
-		for k in dir(self):
-			if not k.startswith('_'):
-				v = getattr(self, k)
-				if isinstance(v, str) and v.startswith('\033'):
-					setattr(self, k, '')
-
-	@classmethod
-	def s1(self, msg):
-		self.out('%s*** %s%s\n' % (self.s1reset, msg, self.reset))
-	@classmethod
-	def s2(self, msg):
-		self.out('%s->%s  %s\n' % (self.s2reset, self.reset, msg))
-	@classmethod
-	def s3(self, msg):
-		self.out('%s-->%s %s\n' % (self.s3reset, self.reset, msg))
-
-	@classmethod
-	def err(self, msg):
-		self.out('%s!!!%s %s%s%s\n' % (self.red, self.reset, self.errreset, msg, self.reset))
-
-	@staticmethod
-	def out(msg):
-		sys.stderr.write(msg)
+from SmartLiveRebuild.output import out
 
 class NonLiveEbuild(Exception):
 	pass