From 954aba731e746dbeebcf78adb2bbcf04a7f1cd2c Mon Sep 17 00:00:00 2001 From: DjMelik Date: Tue, 24 Aug 2010 10:17:58 -0700 Subject: fixed double output bug for debian/ubuntu --- archey | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/archey b/archey index 57227f0..90537b0 100644 --- a/archey +++ b/archey @@ -3,7 +3,7 @@ # archey [version 0.2.5] # # Maintained by Melik Manukyan -# Changes Jérôme Launay +# Changes Jerome Launay # Distributed under the terms of the GNU General Public License v3. # See http://www.gnu.org/licenses/gpl.txt for the full license text. # @@ -37,7 +37,7 @@ result = [] # Options if __name__=='__main__': - parser = OptionParser(usage='%prog [-s, --screenshot]', description='Archey is a system information tool written in Python.', version="%prog 0.2.4") + parser = OptionParser(usage='%prog [-s, --screenshot]', description='Archey is a system information tool written in Python.', version="%prog 0.2.5") parser.add_option('-s', '--screenshot', action='store_true', dest='screenshot', help='take a screenshot') (options, args) = parser.parse_args() @@ -111,24 +111,22 @@ p1 = None # Find Distro. DetectUbuntu = os.path.exists('/etc/lsb-release') if DetectUbuntu: + DetectDebian = False DetectUbuntu = Popen(['grep', '-i', 'ubuntu', '/etc/lsb-release'], stdout=PIPE) DetectArch = os.path.exists('/etc/arch-release') -DetectDebian = os.path.exists('/etc/debian_version') - +if not DetectUbuntu: + DetectDebian = os.path.exists('/etc/debian_version') # Print coloured key with normal value. def output(key, value): if DetectUbuntu: - ucolor = '\x1b[1;31m' - output ='%s%s:%s %s' % (ucolor, key, clear, value) + output ='%s%s:%s %s' % (ucolor2, key, clear, value) if DetectArch: - ucolor = '\x1b[1;34m' output = '%s%s:%s %s' % (acolor, key, clear, value) if DetectDebian: - ucolor = '\x1b[1;33m' - output = '%s%s:%s %s' % (acolor, key, clear, value) + output = '%s%s:%s %s' % (dcolor, key, clear, value) result.append(output) # RAM Function. -- cgit v1.2.3-54-g00ecf