Merge lp:~clicompanion-devs/clicompanion/branch-km0r3 into lp:clicompanion

Proposed by Kenny Meyer
Status: Merged
Approved by: Duane Hinnen
Approved revision: 25
Merged at revision: 27
Proposed branch: lp:~clicompanion-devs/clicompanion/branch-km0r3
Merge into: lp:clicompanion
Diff against target: 76 lines (+26/-15)
2 files modified
.clicompanion (+11/-11)
clicompanion.0.0.7.py (+15/-4)
To merge this branch: bzr merge lp:~clicompanion-devs/clicompanion/branch-km0r3
Reviewer Review Type Date Requested Status
Duane Hinnen Approve
Review via email: mp+31806@code.launchpad.net

Description of the change

Fixed lp:611145

To post a comment you must log in.
Revision history for this message
Duane Hinnen (duanedesign) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.clicompanion'
2--- .clicompanion 2010-08-01 04:10:34 +0000
3+++ .clicompanion 2010-08-05 00:43:40 +0000
4@@ -1,15 +1,15 @@
5 dpkg -l: package : Find version of a package
6-df -h : : file system disk space usage
7-free -m : : show RAM usage
8-ps auxww | grep : process : displays information about the active process
9-iwconfig : : Display wireless network information
10-ifconfig -a : : displays the status of the currently active interfaces
11-sudo iwlist : : scan Scan Wireless networks
12-sudo /etc/init.d/networking restart : : Reset the Network
13-lsb_release -a : : What version of Ubuntu do I have?
14-uname -a : : What kernel am I running
15-sudo apt-get update && sudo apt-get upgrade : : Refresh update info and update all packages
16-sudo apt-get clean : : clear out all packages in /var/cache/apt/archives
17+df -h: : file system disk space usage
18+free -m: : show RAM usage
19+ps auxww | grep: process : displays information about the active process
20+iwconfig: : Display wireless network information
21+ifconfig -a: : displays the status of the currently active interfaces
22+sudo iwlist: : scan Scan Wireless networks
23+sudo /etc/init.d/networking restart: : Reset the Network
24+lsb_release -a: : What version of Ubuntu do I have?
25+uname -a: : What kernel am I running
26+sudo apt-get update && sudo apt-get upgrade: : Refresh update info and update all packages
27+sudo apt-get clean: : clear out all packages in /var/cache/apt/archives
28 sudo apt-get autoclean : : clear out obsolete packages(packages with a newer release)
29 apt-cache search :package : Find information on a package (not installed)
30 sudo lshw : : List hardware
31
32=== modified file 'clicompanion.0.0.7.py'
33--- clicompanion.0.0.7.py 2010-08-01 04:10:34 +0000
34+++ clicompanion.0.0.7.py 2010-08-05 00:43:40 +0000
35@@ -228,10 +228,10 @@
36 # Python raises a TypeError if row data doesn't exist. Catch
37 # that and fail silently.
38 pass
39-
40+
41 modelfilter.set_visible_func(search, search_term)
42 self.treeview.set_model(modelfilter)
43-
44+
45 #send the command to the terminal
46 def run_command(self, widget, data=None):
47 global ROW
48@@ -248,15 +248,26 @@
49 Companion.vte.feed_child(cmnd+"\n") #send command
50 Companion.vte.show()
51 Companion.vte.grab_focus()
52-
53+
54 #open the man page for selected command
55 def man_page(self, widget, data=None):
56 row_int = int(ROW[0][0]) # removes everything but number from EX: [5,]
57 cmnd = CMNDS[row_int] #CMNDS is where commands are store
58- splitcommand=cmnd.split(" ")
59+ splitcommand = self._filter_sudo_from(cmnd.split(" "))
60 Companion.vte.feed_child("man "+splitcommand[0]+"| most \n") #send command
61 self.vte.grab_focus()
62 Companion.vte.show()
63+
64+ @staticmethod
65+ def _filter_sudo_from(command):
66+ """Filter the sudo from `command`, where `command` is a list.
67+
68+ Return the command list with the "sudo" filtered out.
69+ """
70+ if command[0].startswith("sudo"):
71+ del command[0]
72+ return command
73+ return command
74
75 # open file containing command dictionary and put it in a variable
76 def update(self):

Subscribers

People subscribed via source and target branches