summaryrefslogtreecommitdiffstats
path: root/mountconfig/fuser.py
diff options
context:
space:
mode:
Diffstat (limited to 'mountconfig/fuser.py')
-rw-r--r--mountconfig/fuser.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/mountconfig/fuser.py b/mountconfig/fuser.py
index 9780555..06cf1a9 100644
--- a/mountconfig/fuser.py
+++ b/mountconfig/fuser.py
@@ -73,7 +73,7 @@ class FileProcess(TQListViewItem):
""" Parses a signal string representation or a signal number and sends it to
the process."""
if not self.isparent:
- print "Item is not a process, only a filedescriptor."
+ print("Item is not a process, only a filedescriptor.")
return
try:
signal_int = int(signal)
@@ -81,17 +81,17 @@ class FileProcess(TQListViewItem):
try:
signal_int = self.signals[signal]
except IndexError:
- print "No known signal received ", signal
+ print("No known signal received ", signal)
return False
try:
rc = os.kill(int(self.pid),signal_int) # TODO: Catch OSError
- except OSError, message:
- print "OSError: Couldn't %s %s %s" % (signal,self.pname,self.pid)
- print message
+ except OSError as message:
+ print("OSError: Couldn't %s %s %s" % (signal,self.pname,self.pid))
+ print(message)
if not rc:
- print "Successfully sent signal ", signal_int, " to process ", self.pid
+ print("Successfully sent signal ", signal_int, " to process ", self.pid)
return True
- print "Signal %i didn't succeed" % signal_int
+ print("Signal %i didn't succeed" % signal_int)
return False
def fillColumns(self):
@@ -125,7 +125,7 @@ class FUser(FUserUI):
self.umountbutton.setEnabled(False)
self.explanationlabel.setText(
- unicode(i18n("""The volume %s is in use and can not be disabled.<br>
+ str(i18n("""The volume %s is in use and can not be disabled.<br>
<br>
The processes that are blocking %s are listed below. These processes must be closed
before %s can be disabled.
@@ -159,7 +159,7 @@ class FUser(FUserUI):
if os.path.isfile(path):
self.lsof_bin = path
else:
- print path, " is not a valid binary, keeping %s", self.lsof_bin
+ print(path, " is not a valid binary, keeping %s", self.lsof_bin)
def readPixmaps(self):
self.pix = {
@@ -185,7 +185,7 @@ class FUser(FUserUI):
type = line[0]
info = line[1:]
- if type is "p":
+ if type == "p":
pid = info
parentproc = FileProcess(self.processlist,pid,True)
self.processes.append(parentproc)
@@ -243,7 +243,7 @@ class FUser(FUserUI):
self.processlist.selectedItem().sendSignal("KILL")
self.refreshProcesslist()
except AttributeError:
- print "No killable item selected."
+ print("No killable item selected.")
def slotKillallButtonClicked(self):
for process in self.realprocesses:
@@ -266,17 +266,17 @@ class FUser(FUserUI):
SimpleCommandRunner
rc, output = SimpleCommandRunner().run(['/bin/umount',self.device])
if rc == 0:
- print "%s successfully unmounted." % self.device
+ print("%s successfully unmounted." % self.device)
# Close dialog and return 0 - sucessfully umounted.
self.done(0)
else:
- print "Unmounting %s failed: %s" % (self.device,output[:-1])
+ print("Unmounting %s failed: %s" % (self.device,output[:-1]))
self.isMounted()
################################################################################################
if standalone:
device = "/dev/hda1"
- print 'Device is ', device
+ print('Device is ', device)
cmd_args = TDECmdLineArgs.init(sys.argv, "FUser",
"A graphical frontend to fuser, but without using it :-)", "0.2")