示例#1
0
文件: setup.py 项目: fwin-dev/py.OS
	def preInstall(self):
		if sys.version_info[0] >= 3 or sys.version_info <= (2,5):
			raise Exception("This module only supports Python 2.6 or 2.7")
		
		from Lang import DescribeOS
		if DescribeOS.isDebianBased():
			global requirements
			requirements.append("python-apt")
		elif DescribeOS.isRedHatBased():
			# red hat based OSs come with a python yum module already installed
			try:
				import yum
			except ImportError:
				raise Exception("Error: Could not find the python yum module. If you installed py.OS in a virtualenv, use --system-site-packages to give access to python yum. You will need to re-create the virtualenv to do this.")
示例#2
0
文件: _apt.py 项目: fwin-dev/py.OS
	def isSupported(cls):
		return DescribeOS.isDebianBased()