Merge lp:~clicompanion-devs/clicompanion/fix-819038 into lp:clicompanion
- fix-819038
- Merge into trunk
Proposed by
Marek Bardoński
Status: | Merged |
---|---|
Merge reported by: | Marek Bardoński |
Merged at revision: | not available |
Proposed branch: | lp:~clicompanion-devs/clicompanion/fix-819038 |
Merge into: | lp:clicompanion |
Diff against target: |
283 lines (+138/-103) 4 files modified
.clicompanion (+48/-48) clicompanionlib/controller.py (+2/-2) clicompanionlib/view.py (+38/-3) data/clicompanion2.config (+50/-50) |
To merge this branch: | bzr merge lp:~clicompanion-devs/clicompanion/fix-819038 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
stlsaint | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message

stlsaint (stlsaint) : | # |
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-09-20 01:15:23 +0000 |
3 | +++ .clicompanion 2011-11-20 16:57:23 +0000 |
4 | @@ -1,48 +1,48 @@ |
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 | -sudo apt-get autoclean : : clear out obsolete packages(packages with a newer release) |
18 | -apt-cache search @ :package : Find information on a package (not installed) |
19 | -sudo lshw : : List hardware |
20 | -lspci : : list all PCI devices |
21 | -aplay -l : : List all soundcards and digital audio devices |
22 | -cat @ :path: Read File & Print to Standard Output |
23 | -ls @ :path : List Folders Contents |
24 | -ls -lSr @ :path : Show files by size, biggest last |
25 | -mv @ :path : Move (Rename) Files |
26 | -cp @ :path : Copy Files |
27 | -sudo lspci : : attached PCI devices |
28 | -chmod @ @ : permissions, file : Change access permissions, change mode |
29 | -chown @ @: owner:group, file : Change the owner and/or group of each given file |
30 | -dmesg : : Print kernel & driver messages |
31 | -history : : Command History |
32 | -locate @ : file : Find files (updatedb to update DB) |
33 | -sudo updatedb : : update the database for locate |
34 | -which @ :command : Show full path name of command |
35 | -find -maxdepth 1 -type f | xargs grep -F @ :string : Search all regular files for 'string' in this dir |
36 | -gpg -c @ :file : Encypt a file |
37 | -gpg @ :file.gpg : Decrypt a file |
38 | -tar -xjf @ :archive.tar : Extract all files from archive.tar |
39 | -tar -czf @ :Destination.tar.gz Source : Create Destination from Source |
40 | -iostat : : cpu and I/O statistics |
41 | -netstat : : Print network connections and interface statistics |
42 | -sudo fdisk -l @ :disk : List partition tables for specified devices |
43 | -sudo ufw enable : : Enable netfilter firewall |
44 | -sudo ufw allow @ :port : Open a port in netfilter firewall |
45 | -sudo ufw deny @ :port : Close a port in netfilter firewall |
46 | -sudo ufw disable : : Disable netfilter firewall |
47 | -cat @ @ | sort | uniq > @ : file1, file2, file3 : combine, sort and remove duplicates from 2 files |
48 | -mkisofs -V LABEL -r dir | gzip > @ :isoname.iso.gz : Create cdrom image from contents of directory |
49 | -cdrecord -v dev=/dev/cdrom -audio -pad *.wav : : Make audio CD from all wavs in current dir |
50 | -dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n : : List all installed packages by size |
51 | -tail -f /var/log/messages : : Monitor messages log file |
52 | -apropos @ :command/package : search the manual page names and descriptions |
53 | +dpkg -l @ package Find version of a package |
54 | +df -h file system disk space usage |
55 | +free -m show RAM usage |
56 | +ps auxww | grep @ process displays information about the active process |
57 | +iwconfig Display wireless network information |
58 | +ifconfig -a displays the status of the currently active interfaces |
59 | +sudo iwlist scan Scan Wireless networks |
60 | +sudo /etc/init.d/networking restart Reset the Network |
61 | +lsb_release -a What version of Ubuntu do I have? |
62 | +uname -a What kernel am I running |
63 | +sudo apt-get update && sudo apt-get upgrade Refresh update info and update all packages |
64 | +sudo apt-get clean clear out all packages in /var/cache/apt/archives |
65 | +sudo apt-get autoclean clear out obsolete packages(packages with a newer release) |
66 | +apt-cache search @ package Find information on a package (not installed) |
67 | +sudo lshw List hardware |
68 | +lspci list all PCI devices |
69 | +aplay -l List all soundcards and digital audio devices |
70 | +cat @ path Read File & Print to Standard Output |
71 | +ls @ path List Folders Contents |
72 | +ls -lSr @ path Show files by size, biggest last |
73 | +mv @ path Move (Rename) Files |
74 | +cp @ path Copy Files |
75 | +sudo lspci attached PCI devices |
76 | +chmod @ @ permissions, file Change access permissions, change mode |
77 | +chown @ @ owner group, file Change the owner and/or group of each given file |
78 | +dmesg Print kernel & driver messages |
79 | +history Command History |
80 | +locate @ file Find files (updatedb to update DB) |
81 | +sudo updatedb update the database for locate |
82 | +which @ command Show full path name of command |
83 | +find -maxdepth 1 -type f | xargs grep -F @ string Search all regular files for 'string' in this dir |
84 | +gpg -c @ file Encypt a file |
85 | +gpg @ file.gpg Decrypt a file |
86 | +tar -xjf @ archive.tar Extract all files from archive.tar |
87 | +tar -czf @ Destination.tar.gz Source Create Destination from Source |
88 | +iostat cpu and I/O statistics |
89 | +netstat Print network connections and interface statistics |
90 | +sudo fdisk -l @ disk List partition tables for specified devices |
91 | +sudo ufw enable Enable netfilter firewall |
92 | +sudo ufw allow @ port Open a port in netfilter firewall |
93 | +sudo ufw deny @ port Close a port in netfilter firewall |
94 | +sudo ufw disable Disable netfilter firewall |
95 | +cat @ @ | sort | uniq > @ file1, file2, file3 combine, sort and remove duplicates from 2 files |
96 | +mkisofs -V LABEL -r dir | gzip > @ isoname.iso.gz Create cdrom image from contents of directory |
97 | +cdrecord -v dev=/dev/cdrom -audio -pad *.wav Make audio CD from all wavs in current dir |
98 | +dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n List all installed packages by size |
99 | +tail -f /var/log/messages Monitor messages log file |
100 | +apropos @ command/package search the manual page names and descriptions |
101 | |
102 | === modified file 'clicompanionlib/controller.py' |
103 | --- clicompanionlib/controller.py 2011-11-16 10:48:50 +0000 |
104 | +++ clicompanionlib/controller.py 2011-11-20 16:57:23 +0000 |
105 | @@ -160,12 +160,12 @@ |
106 | if text1 != "": |
107 | with open(CHEATSHEET, "r") as cheatfile: |
108 | cheatlines = cheatfile.readlines() |
109 | - cheatlines.append(text1+":"+text2+":"+text3+'\n') |
110 | + cheatlines.append(text1+"\t"+text2+"\t"+text3+'\n') |
111 | cheatfile.close() |
112 | with open(CHEATSHEET, "w") as cheatfile2: |
113 | cheatfile2.writelines(cheatlines) |
114 | cheatfile2.close() |
115 | - l = str(text1+":"+text2+":"+text3) |
116 | + l = str(text1+"\t"+text2+"\t"+text3) |
117 | #ls = l.split(':',2) |
118 | ## update view.CMNDS variable |
119 | filteredcommandplus = text1, text2, text3 |
120 | |
121 | === modified file 'clicompanionlib/view.py' |
122 | --- clicompanionlib/view.py 2011-11-11 11:40:07 +0000 |
123 | +++ clicompanionlib/view.py 2011-11-20 16:57:23 +0000 |
124 | @@ -103,8 +103,16 @@ |
125 | self.update(self.liststore) |
126 | |
127 | ## add bug data from .clicompanion --> bugdata --> to the liststore |
128 | - for line in bugdata.splitlines(): |
129 | - l = line.split(':',2) |
130 | + for line in bugdata.splitlines(): |
131 | + l = line.split('\t',2) |
132 | + if len(l) < 2: |
133 | + """ |
134 | + If for any reason we have a old file, we must |
135 | + replace it by new one |
136 | + """ |
137 | + print "PLEASE RESTART APPLICATION TO FINISH UPDATE" |
138 | + self.setup() |
139 | + return |
140 | commandplus = l[0], l[1], l[2] |
141 | CMNDS.append(commandplus) |
142 | self.liststore.append([l[0],l[1],l[2]]) |
143 | @@ -125,7 +133,34 @@ |
144 | # Oops! Looks like there's no cheatsheet in CHEATSHEET. |
145 | # Then, create an empty cheatsheet. |
146 | open(CHEATSHEET, 'w').close() |
147 | - |
148 | + """ |
149 | + If we have old file, we must replace it by fresh list |
150 | + """ |
151 | + cheatlines = [] |
152 | + try: |
153 | + with open(CHEATSHEET, "r") as cheatfile: |
154 | + bugdata=cheatfile.read() |
155 | + cheatfile.close() |
156 | + for line in bugdata.splitlines(): |
157 | + l = line.split('\t', 2) |
158 | + if len(l) < 2: |
159 | + l = line.split(':', 2) |
160 | + p = str(l[0] + "\t"+ l[1] +"\t"+ l[2] + "\n") |
161 | + cheatlines.append(p) |
162 | + else: |
163 | + cheatlines.append(str(l[0] + "\t"+ l[1] +"\t"+ l[2] + "\n")) |
164 | + |
165 | + with open(CHEATSHEET, "w") as cheatfile2: |
166 | + cheatfile2.writelines(cheatlines) |
167 | + cheatfile2.close() |
168 | + |
169 | + except IOError: |
170 | + ## CHEATSHEET is not there. Oh, no! |
171 | + ## So, run self.setup() again. |
172 | + self.setup() |
173 | + ## Then, run me again. |
174 | + self.update(self.liststore) |
175 | + |
176 | |
177 | #liststore in a scrolled window in an expander |
178 | def expanded_cb(self, expander, params, window, search_box): |
179 | |
180 | === modified file 'data/clicompanion2.config' |
181 | --- data/clicompanion2.config 2011-11-19 17:36:13 +0000 |
182 | +++ data/clicompanion2.config 2011-11-20 16:57:23 +0000 |
183 | @@ -1,50 +1,50 @@ |
184 | -dpkg -l ?:package:Find version of a package |
185 | -df -h::File system disk space usage |
186 | -free -m::Show RAM usage |
187 | -ps aux | grep ?:search string:Search active processes for search string |
188 | -iwconfig::Display wireless network information |
189 | -ifconfig -a::Displays the status of the currently active interfaces |
190 | -lsb_release -a::What version of Ubuntu do I have? |
191 | -uname -a::What kernel am I running |
192 | -sudo apt-get update && sudo apt-get upgrade::Refresh update info and update all packages |
193 | -sudo apt-get clean::Clear out all packages in /var/cache/apt/archives |
194 | -sudo apt-get autoclean::Clear out obsolete packages(packages with a newer release) |
195 | -apt-cache search ?:package:Find information on a package (not installed) |
196 | -sudo lshw::List hardware |
197 | -lspci::List all PCI devices |
198 | -aplay -l::List all soundcards and digital audio devices |
199 | -cat ?:path:Read File & Print to Standard Output |
200 | -ls ? :path:List Folders Contents |
201 | -ls -lSr ?:path:Show files by size, biggest last |
202 | -mv ? ?:sourcePath, destinationPath:Move (Rename) Files |
203 | -cp ? ?:sourcePath, destinationPath:Copy File from sourcePath to destinationPath |
204 | -sudo lspci::attached PCI devices |
205 | -chmod ? ?:permissions, file:Change access permissions, change mode |
206 | -chown ? ?:owner:group, file:Change the owner and/or group of each given file |
207 | -dmesg::Print kernel & driver messages |
208 | -history::Command History |
209 | -history | grep -i ?:command:search history for a command |
210 | -locate ?:file:Find files (updatedb to update DB) |
211 | -sudo updatedb::update the database for locate |
212 | -which ?:command:Show full path name of command |
213 | -find -maxdepth 1 -type f | xargs grep -F ?:string:Search all regular files for 'string' in this dir |
214 | -gpg -c ?:file:Encypt a file |
215 | -gpg ?:file.gpg:Decrypt a file |
216 | -tar -cvf ? ?:Destination.tar Source:Compress(tar) Source into Destination |
217 | -tar -cvzf ? ?:Destination.tar.gz Source:Compress(tar.gz) Source into Destination |
218 | -tar -cjvf ? ?:Destination.tar.bz2 Source:Compress(tar.bz2) Source into Destination |
219 | -tar xvf ?:file:decompress/extract .tar |
220 | -tar xvzf ?:file:decompress/extract tar.gz |
221 | -tar xjvf ?:file:decompress/extract a tar.bz2 |
222 | -sudo dpkg --configure -a::help fix broken packages |
223 | -sudo apt-get -f install::help fix broken packages |
224 | -top::display Linux tasks |
225 | -netstat::Print network connections and interface statistics |
226 | -sudo fdisk -l ?:disk(usually /dev/sda):List partition tables for specified devices |
227 | -sudo ufw enable::Enable netfilter firewall |
228 | -sudo ufw allow ?:port:Open a port in netfilter firewall |
229 | -sudo ufw deny ?:port:Close a port in netfilter firewall |
230 | -sudo ufw disable::Disable netfilter firewall |
231 | -cat ? ? | sort | uniq > ? :file1, file2, file3:combine, sort and remove duplicates from 2 files |
232 | -dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n::List all installed packages by size |
233 | -apropos ?:command or package:search the manual page names and descriptions |
234 | +dpkg -l ? package Find version of a package |
235 | +df -h File system disk space usage |
236 | +free -m Show RAM usage |
237 | +ps aux | grep ? search string Search active processes for search string |
238 | +iwconfig Display wireless network information |
239 | +ifconfig -a Displays the status of the currently active interfaces |
240 | +lsb_release -a What version of Ubuntu do I have? |
241 | +uname -a What kernel am I running |
242 | +sudo apt-get update && sudo apt-get upgrade Refresh update info and update all packages |
243 | +sudo apt-get clean Clear out all packages in /var/cache/apt/archives |
244 | +sudo apt-get autoclean Clear out obsolete packages(packages with a newer release) |
245 | +apt-cache search ? package Find information on a package (not installed) |
246 | +sudo lshw List hardware |
247 | +lspci List all PCI devices |
248 | +aplay -l List all soundcards and digital audio devices |
249 | +cat ? path Read File & Print to Standard Output |
250 | +ls ? path List Folders Contents |
251 | +ls -lSr ? path Show files by size, biggest last |
252 | +mv ? ? sourcePath, destinationPath Move (Rename) Files |
253 | +cp ? ? sourcePath, destinationPath Copy File from sourcePath to destinationPath |
254 | +sudo lspci attached PCI devices |
255 | +chmod ? ? permissions, file Change access permissions, change mode |
256 | +chown ? ? owner group, file Change the owner and/or group of each given file |
257 | +dmesg Print kernel & driver messages |
258 | +history Command History |
259 | +history | grep -i ? command search history for a command |
260 | +locate ? file Find files (updatedb to update DB) |
261 | +sudo updatedb update the database for locate |
262 | +which ? command Show full path name of command |
263 | +find -maxdepth 1 -type f | xargs grep -F ? string Search all regular files for 'string' in this dir |
264 | +gpg -c ? file Encypt a file |
265 | +gpg ? file.gpg Decrypt a file |
266 | +tar -cvf ? ? Destination.tar Source Compress(tar) Source into Destination |
267 | +tar -cvzf ? ? Destination.tar.gz Source Compress(tar.gz) Source into Destination |
268 | +tar -cjvf ? ? Destination.tar.bz2 Source Compress(tar.bz2) Source into Destination |
269 | +tar xvf ? file decompress/extract .tar |
270 | +tar xvzf ? file decompress/extract tar.gz |
271 | +tar xjvf ? file decompress/extract a tar.bz2 |
272 | +sudo dpkg --configure -a help fix broken packages |
273 | +sudo apt-get -f install help fix broken packages |
274 | +top display Linux tasks |
275 | +netstat Print network connections and interface statistics |
276 | +sudo fdisk -l ? disk(usually /dev/sda) List partition tables for specified devices |
277 | +sudo ufw enable Enable netfilter firewall |
278 | +sudo ufw allow ? port Open a port in netfilter firewall |
279 | +sudo ufw deny ? port Close a port in netfilter firewall |
280 | +sudo ufw disable Disable netfilter firewall |
281 | +cat ? ? | sort | uniq > ? file1, file2, file3 combine, sort and remove duplicates from 2 files |
282 | +dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n List all installed packages by size |
283 | +apropos ? command or package search the manual page names and descriptions |