[Pypt-offline-general] SF.net SVN: pypt-offline: [126] trunk
Status: Beta
Brought to you by:
riteshsarraf
|
From: <rit...@us...> - 2007-02-11 09:43:21
|
Revision: 126
http://svn.sourceforge.net/pypt-offline/?rev=126&view=rev
Author: riteshsarraf
Date: 2007-02-11 01:43:21 -0800 (Sun, 11 Feb 2007)
Log Message:
-----------
* Move from sys.paltform to platform.system(). The output of sys.platform has not been consistent
It has rather been confusing. IMO, sys.paltform outputs the details on the platform the python interpreter
was built.
Modified Paths:
--------------
trunk/pypt_core.py
trunk/pypt_variables.py
Modified: trunk/pypt_core.py
===================================================================
--- trunk/pypt_core.py 2007-02-06 12:25:17 UTC (rev 125)
+++ trunk/pypt_core.py 2007-02-11 09:43:21 UTC (rev 126)
@@ -1,4 +1,4 @@
-import os, shutil, string, sys, urllib2, Queue, threading
+import os, shutil, string, sys, urllib2, Queue, threading, platform
import pypt_progressbar, pypt_md5_check, pypt_variables, pypt_logger, pypt_progressbar
'''This is the core module. It does the main job of downloading packages/update packages,\nfiguring out if the packages are in the local cache, handling exceptions and many more stuff'''
@@ -696,7 +696,7 @@
log.msg("Copyright %s\n" % (pypt_variables.copyright))
if pypt_variables.options.set_update:
- if sys.platform in pypt_variables.supported_platforms:
+ if platform.system() in pypt_variables.supported_platforms:
if os.geteuid() != 0:
pypt_variables.parser.error("This option requires super-user privileges. Execute as root or use sudo/su")
else:
@@ -712,7 +712,7 @@
if not (pypt_variables.options.set_upgrade and pypt_variables.options.upgrade_type):
pypt_variables.parser.error("Options --set-upgrade and --upgrade-type are mutually inclusive\n")
- if sys.platform in pypt_variables.supported_platforms:
+ if platform.system() in pypt_variables.supported_platforms:
if os.geteuid() != 0:
pypt_variables.parser.error("This option requires super-user privileges. Execute as root or use sudo/su")
#TODO: Use a more Pythonic way for it
@@ -741,7 +741,7 @@
if not (pypt_variables.options.set_install_packages and pypt_variables.options.set_install):
pypt_variables.parser.error("Options --set-install and --set-install-package are mutually inclusive\n")
- if sys.platform in pypt_variables.supported_platforms:
+ if platform.system() in pypt_variables.supported_platforms:
if os.geteuid() != 0:
pypt_variables.parser.error("This option requires super-user privileges. Execute as root or use sudo/su")
Modified: trunk/pypt_variables.py
===================================================================
--- trunk/pypt_variables.py 2007-02-06 12:25:17 UTC (rev 125)
+++ trunk/pypt_variables.py 2007-02-11 09:43:21 UTC (rev 126)
@@ -7,7 +7,7 @@
copyright = "(C) 2005 - 2007 Ritesh Raj Sarraf - RESEARCHUT (http://www.researchut.com/)"
errlist = []
-supported_platforms = ["linux2", "gnu0", "gnukfreebsd5"]
+supported_platforms = ["Linux", "GNU/kFreeBSD", "GNU"]
apt_update_target_path = '/var/lib/apt/lists/'
apt_package_target_path = '/var/cache/apt/archives/'
# Dummy paths while testing on Windows
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|