← Back to team overview

clicompanion-devs team mailing list archive

[Merge] lp:~clicompanion-devs/clicompanion/fix-819038 into lp:clicompanion

 

Marek Bardoński has proposed merging lp:~clicompanion-devs/clicompanion/fix-819038 into lp:clicompanion.

Requested reviews:
  CLI Companion Development Team (clicompanion-devs)
Related bugs:
  Bug #819038 in CLI Companion: "if the command has ":" character, the command gets broken into two"
  https://bugs.launchpad.net/clicompanion/+bug/819038

For more details, see:
https://code.launchpad.net/~clicompanion-devs/clicompanion/fix-819038/+merge/82822
-- 
https://code.launchpad.net/~clicompanion-devs/clicompanion/fix-819038/+merge/82822
Your team CLI Companion Development Team is requested to review the proposed merge of lp:~clicompanion-devs/clicompanion/fix-819038 into lp:clicompanion.
=== modified file '.clicompanion'
--- .clicompanion	2010-09-20 01:15:23 +0000
+++ .clicompanion	2011-11-20 16:55:28 +0000
@@ -1,48 +1,48 @@
-dpkg -l @: package : Find version of a package
-df -h: : file system disk space usage
-free -m: : show RAM usage
-ps auxww | grep @: process : displays information about the active process
-iwconfig: : Display wireless network information
-ifconfig -a: : displays the status of the currently active interfaces
-sudo iwlist: : scan Scan Wireless networks
-sudo /etc/init.d/networking restart: : Reset the Network
-lsb_release -a: : What version of Ubuntu do I have?
-uname -a: : What kernel am I running
-sudo apt-get update && sudo apt-get upgrade: : Refresh update info and update all packages 
-sudo apt-get clean: : clear out all packages in /var/cache/apt/archives
-sudo apt-get autoclean : : clear out obsolete packages(packages with a newer release)
-apt-cache search @ :package : Find information on a package (not installed)
-sudo lshw : : List hardware 
-lspci : : list all PCI devices
-aplay -l : : List all soundcards and digital audio devices
-cat @ :path: Read File & Print to Standard Output
-ls @ :path : List Folders Contents
-ls -lSr @ :path : Show files by size, biggest last
-mv @ :path : Move (Rename) Files
-cp @ :path : Copy Files
-sudo lspci : : attached PCI devices
-chmod @ @ : permissions, file : Change access permissions, change mode
-chown @ @: owner:group, file : Change the owner and/or group of each given file
-dmesg : : Print kernel & driver messages
-history : : Command History
-locate @ : file : Find files (updatedb to update DB)
-sudo updatedb : : update the database for locate
-which @ :command : Show full path name of command
-find -maxdepth 1 -type f | xargs grep -F @ :string : Search all regular files for 'string' in this dir
-gpg -c @ :file : Encypt a file
-gpg @ :file.gpg : Decrypt a file
-tar -xjf @ :archive.tar : Extract all files from archive.tar
-tar -czf @ :Destination.tar.gz  Source : Create Destination from Source
-iostat : : cpu and I/O statistics
-netstat : : Print network connections and interface statistics
-sudo fdisk -l @ :disk : List partition tables for specified devices
-sudo ufw enable : : Enable netfilter firewall
-sudo ufw allow @ :port : Open a port in netfilter firewall
-sudo ufw deny @ :port : Close a port in netfilter firewall
-sudo ufw disable : : Disable netfilter firewall
-cat @ @ | sort | uniq > @ : file1, file2, file3 : combine, sort and remove duplicates from 2 files
-mkisofs -V LABEL -r dir | gzip > @ :isoname.iso.gz : Create cdrom image from contents of directory
-cdrecord -v dev=/dev/cdrom -audio -pad *.wav : : Make audio CD from all wavs in current dir
-dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n : : List all installed packages by size
-tail -f /var/log/messages : : Monitor messages log file
-apropos @ :command/package : search the manual page names and descriptions
+dpkg -l @	 package 	 Find version of a package
+df -h	 	 file system disk space usage
+free -m	 	 show RAM usage
+ps auxww | grep @	 process 	 displays information about the active process
+iwconfig	 	 Display wireless network information
+ifconfig -a	 	 displays the status of the currently active interfaces
+sudo iwlist	 	 scan Scan Wireless networks
+sudo /etc/init.d/networking restart	 	 Reset the Network
+lsb_release -a	 	 What version of Ubuntu do I have?
+uname -a	 	 What kernel am I running
+sudo apt-get update && sudo apt-get upgrade	 	 Refresh update info and update all packages 
+sudo apt-get clean	 	 clear out all packages in /var/cache/apt/archives
+sudo apt-get autoclean 	 	 clear out obsolete packages(packages with a newer release)
+apt-cache search @ 	package 	 Find information on a package (not installed)
+sudo lshw 	 	 List hardware 
+lspci 	 	 list all PCI devices
+aplay -l 	 	 List all soundcards and digital audio devices
+cat @ 	path	 Read File & Print to Standard Output
+ls @ 	path 	 List Folders Contents
+ls -lSr @ 	path 	 Show files by size, biggest last
+mv @ 	path 	 Move (Rename) Files
+cp @ 	path 	 Copy Files
+sudo lspci 	 	 attached PCI devices
+chmod @ @ 	 permissions, file 	 Change access permissions, change mode
+chown @ @	 owner	group, file 	 Change the owner and/or group of each given file
+dmesg 	 	 Print kernel & driver messages
+history 	 	 Command History
+locate @ 	 file 	 Find files (updatedb to update DB)
+sudo updatedb 	 	 update the database for locate
+which @ 	command 	 Show full path name of command
+find -maxdepth 1 -type f | xargs grep -F @ 	string 	 Search all regular files for 'string' in this dir
+gpg -c @ 	file 	 Encypt a file
+gpg @ 	file.gpg 	 Decrypt a file
+tar -xjf @ 	archive.tar 	 Extract all files from archive.tar
+tar -czf @ 	Destination.tar.gz  Source 	 Create Destination from Source
+iostat 	 	 cpu and I/O statistics
+netstat 	 	 Print network connections and interface statistics
+sudo fdisk -l @ 	disk 	 List partition tables for specified devices
+sudo ufw enable 	 	 Enable netfilter firewall
+sudo ufw allow @ 	port 	 Open a port in netfilter firewall
+sudo ufw deny @ 	port 	 Close a port in netfilter firewall
+sudo ufw disable 	 	 Disable netfilter firewall
+cat @ @ | sort | uniq > @ 	 file1, file2, file3 	 combine, sort and remove duplicates from 2 files
+mkisofs -V LABEL -r dir | gzip > @ 	isoname.iso.gz 	 Create cdrom image from contents of directory
+cdrecord -v dev=/dev/cdrom -audio -pad *.wav 	 	 Make audio CD from all wavs in current dir
+dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n 	 	 List all installed packages by size
+tail -f /var/log/messages 	 	 Monitor messages log file
+apropos @ 	command/package 	 search the manual page names and descriptions

=== modified file 'clicompanionlib/controller.py'
--- clicompanionlib/controller.py	2011-11-16 10:48:50 +0000
+++ clicompanionlib/controller.py	2011-11-20 16:55:28 +0000
@@ -160,12 +160,12 @@
             if text1 != "":
                 with open(CHEATSHEET, "r") as cheatfile:
                     cheatlines = cheatfile.readlines()
-                    cheatlines.append(text1+":"+text2+":"+text3+'\n')
+                    cheatlines.append(text1+"\t"+text2+"\t"+text3+'\n')
                     cheatfile.close()
                 with open(CHEATSHEET, "w") as cheatfile2:
                     cheatfile2.writelines(cheatlines)
                     cheatfile2.close()
-                    l = str(text1+":"+text2+":"+text3)
+                    l = str(text1+"\t"+text2+"\t"+text3)
                     #ls = l.split(':',2)
                     ## update view.CMNDS variable
                     filteredcommandplus = text1, text2, text3

=== modified file 'clicompanionlib/view.py'
--- clicompanionlib/view.py	2011-11-11 11:40:07 +0000
+++ clicompanionlib/view.py	2011-11-20 16:55:28 +0000
@@ -103,8 +103,16 @@
             self.update(self.liststore)
 
         ## add bug data from .clicompanion --> bugdata --> to the liststore
-        for line in bugdata.splitlines():
-            l = line.split(':',2)
+        for line in bugdata.splitlines(): 
+            l = line.split('\t',2) 
+            if len(l) < 2:
+                """
+                If for any reason we have a old file, we must
+                replace it by new one
+                """
+                print "PLEASE RESTART APPLICATION TO FINISH UPDATE"
+                self.setup()
+                return
             commandplus = l[0], l[1], l[2]
             CMNDS.append(commandplus)
             self.liststore.append([l[0],l[1],l[2]])
@@ -125,7 +133,34 @@
                 # Oops! Looks like there's no cheatsheet in CHEATSHEET.
                 # Then, create an empty cheatsheet.
                 open(CHEATSHEET, 'w').close()
-    
+        """
+        If we have old file, we must replace it by fresh list
+        """ 
+        cheatlines = []
+        try:
+            with open(CHEATSHEET, "r") as cheatfile:
+                bugdata=cheatfile.read()
+                cheatfile.close()
+                for line in bugdata.splitlines():
+                    l = line.split('\t', 2)
+                    if len(l) < 2:
+                        l = line.split(':', 2)
+                        p = str(l[0] + "\t"+ l[1] +"\t"+ l[2] + "\n")
+                        cheatlines.append(p)
+                    else:
+                        cheatlines.append(str(l[0] + "\t"+ l[1] +"\t"+ l[2] + "\n"))
+                        
+            with open(CHEATSHEET, "w") as cheatfile2:
+                cheatfile2.writelines(cheatlines)
+                cheatfile2.close()      
+                                     
+        except IOError:
+            ## CHEATSHEET is not there. Oh, no!
+            ## So, run self.setup() again.
+            self.setup()
+            ## Then, run me again.
+            self.update(self.liststore)
+
     
     #liststore in a scrolled window in an expander
     def expanded_cb(self, expander, params, window, search_box):

=== modified file 'data/clicompanion2.config'
--- data/clicompanion2.config	2011-11-19 17:36:13 +0000
+++ data/clicompanion2.config	2011-11-20 16:55:28 +0000
@@ -1,50 +1,50 @@
-dpkg -l ?:package:Find version of a package
-df -h::File system disk space usage
-free -m::Show RAM usage
-ps aux | grep ?:search string:Search active processes for search string
-iwconfig::Display wireless network information
-ifconfig -a::Displays the status of the currently active interfaces
-lsb_release -a::What version of Ubuntu do I have?
-uname -a::What kernel am I running
-sudo apt-get update && sudo apt-get upgrade::Refresh update info and update all packages 
-sudo apt-get clean::Clear out all packages in /var/cache/apt/archives
-sudo apt-get autoclean::Clear out obsolete packages(packages with a newer release)
-apt-cache search ?:package:Find information on a package (not installed)
-sudo lshw::List hardware 
-lspci::List all PCI devices
-aplay -l::List all soundcards and digital audio devices
-cat ?:path:Read File & Print to Standard Output
-ls ? :path:List Folders Contents
-ls -lSr ?:path:Show files by size, biggest last
-mv ? ?:sourcePath, destinationPath:Move (Rename) Files
-cp ? ?:sourcePath, destinationPath:Copy File from sourcePath to destinationPath
-sudo lspci::attached PCI devices
-chmod ? ?:permissions, file:Change access permissions, change mode
-chown ? ?:owner:group, file:Change the owner and/or group of each given file
-dmesg::Print kernel & driver messages
-history::Command History
-history | grep -i ?:command:search history for a command
-locate ?:file:Find files (updatedb to update DB)
-sudo updatedb::update the database for locate
-which ?:command:Show full path name of command
-find -maxdepth 1 -type f | xargs grep -F ?:string:Search all regular files for 'string' in this dir
-gpg -c ?:file:Encypt a file
-gpg ?:file.gpg:Decrypt a file
-tar -cvf ? ?:Destination.tar  Source:Compress(tar) Source into Destination
-tar -cvzf ? ?:Destination.tar.gz  Source:Compress(tar.gz) Source into Destination
-tar -cjvf ? ?:Destination.tar.bz2  Source:Compress(tar.bz2) Source into Destination
-tar xvf ?:file:decompress/extract .tar
-tar xvzf ?:file:decompress/extract tar.gz
-tar xjvf ?:file:decompress/extract a  tar.bz2
-sudo dpkg --configure -a::help fix broken packages
-sudo apt-get -f install::help fix broken packages
-top::display Linux tasks
-netstat::Print network connections and interface statistics
-sudo fdisk -l ?:disk(usually /dev/sda):List partition tables for specified devices
-sudo ufw enable::Enable netfilter firewall
-sudo ufw allow ?:port:Open a port in netfilter firewall
-sudo ufw deny ?:port:Close a port in netfilter firewall
-sudo ufw disable::Disable netfilter firewall
-cat ? ? | sort | uniq > ? :file1, file2, file3:combine, sort and remove duplicates from 2 files
-dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n::List all installed packages by size
-apropos ?:command or package:search the manual page names and descriptions
+dpkg -l ?	package	Find version of a package
+df -h		File system disk space usage
+free -m		Show RAM usage
+ps aux | grep ?	search string	Search active processes for search string
+iwconfig		Display wireless network information
+ifconfig -a		Displays the status of the currently active interfaces
+lsb_release -a		What version of Ubuntu do I have?
+uname -a		What kernel am I running
+sudo apt-get update && sudo apt-get upgrade		Refresh update info and update all packages 
+sudo apt-get clean		Clear out all packages in /var/cache/apt/archives
+sudo apt-get autoclean		Clear out obsolete packages(packages with a newer release)
+apt-cache search ?	package	Find information on a package (not installed)
+sudo lshw		List hardware 
+lspci		List all PCI devices
+aplay -l		List all soundcards and digital audio devices
+cat ?	path	Read File & Print to Standard Output
+ls ? 	path	List Folders Contents
+ls -lSr ?	path	Show files by size, biggest last
+mv ? ?	sourcePath, destinationPath	Move (Rename) Files
+cp ? ?	sourcePath, destinationPath	Copy File from sourcePath to destinationPath
+sudo lspci		attached PCI devices
+chmod ? ?	permissions, file	Change access permissions, change mode
+chown ? ?	owner	group, file	Change the owner and/or group of each given file
+dmesg		Print kernel & driver messages
+history		Command History
+history | grep -i ?	command	search history for a command
+locate ?	file	Find files (updatedb to update DB)
+sudo updatedb		update the database for locate
+which ?	command	Show full path name of command
+find -maxdepth 1 -type f | xargs grep -F ?	string	Search all regular files for 'string' in this dir
+gpg -c ?	file	Encypt a file
+gpg ?	file.gpg	Decrypt a file
+tar -cvf ? ?	Destination.tar  Source	Compress(tar) Source into Destination
+tar -cvzf ? ?	Destination.tar.gz  Source	Compress(tar.gz) Source into Destination
+tar -cjvf ? ?	Destination.tar.bz2  Source	Compress(tar.bz2) Source into Destination
+tar xvf ?	file	decompress/extract .tar
+tar xvzf ?	file	decompress/extract tar.gz
+tar xjvf ?	file	decompress/extract a  tar.bz2
+sudo dpkg --configure -a		help fix broken packages
+sudo apt-get -f install		help fix broken packages
+top		display Linux tasks
+netstat		Print network connections and interface statistics
+sudo fdisk -l ?	disk(usually /dev/sda)	List partition tables for specified devices
+sudo ufw enable		Enable netfilter firewall
+sudo ufw allow ?	port	Open a port in netfilter firewall
+sudo ufw deny ?	port	Close a port in netfilter firewall
+sudo ufw disable		Disable netfilter firewall
+cat ? ? | sort | uniq > ? 	file1, file2, file3	combine, sort and remove duplicates from 2 files
+dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n		List all installed packages by size
+apropos ?	command or package	search the manual page names and descriptions


Follow ups