[Apt-offline-devel] [SCM] Offline APT Package Manager branch, apt-offline-qt, updated. v0.9.9-110-gdeef88f

Manish Sinha manishsinha.tech at gmail.com
Sat Aug 21 15:40:07 UTC 2010


The following commit has been merged in the apt-offline-qt branch:
commit 7e9531f04cd38e0d8b29eb1e21404859ffafb93f
Author: Manish Sinha <manishsinha.tech at gmail.com>
Date:   Sat Jul 17 23:46:55 2010 +0530

    If the user is not logged in with root priviliges, it shows up a prompt

diff --git a/apt-offline-qt.py b/apt-offline-qt.py
index a4fa6a0..6ebf52b 100644
--- a/apt-offline-qt.py
+++ b/apt-offline-qt.py
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# -*- coding: utf-8 -*-
 # apt-offline
 #
 ############################################################################
@@ -22,11 +23,16 @@
 ############################################################################
 
 import sys
+import os
 from PyQt4 import QtCore, QtGui
 from apt_offline_gui.AptOfflineQtMain import AptOfflineQtMain
 
 if __name__ == "__main__":
     app = QtGui.QApplication(sys.argv)
     myapp = AptOfflineQtMain()
-    myapp.show()
-    sys.exit(app.exec_())
+    if os.geteuid() == 0:
+        myapp.show()
+        sys.exit(app.exec_())
+    else:
+        QtGui.QMessageBox.critical(myapp, "Error", "You need to run with root priviliges")
+        

-- 
Offline APT Package Manager



More information about the Apt-offline-devel mailing list