Merge lp:~bdfhjk/clicompanion/version-parser-add into lp:clicompanion

Proposed by Marek Bardoński
Status: Merged
Approved by: Duane Hinnen
Approved revision: 83
Merged at revision: 82
Proposed branch: lp:~bdfhjk/clicompanion/version-parser-add
Merge into: lp:clicompanion
Diff against target: 70 lines (+24/-17)
2 files modified
clicompanion (+1/-1)
clicompanionlib/controller.py (+23/-16)
To merge this branch: bzr merge lp:~bdfhjk/clicompanion/version-parser-add
Reviewer Review Type Date Requested Status
Duane Hinnen Approve
Review via email: mp+63598@code.launchpad.net
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 2011-03-18 15:46:30 +0000
3+++ clicompanion 2011-06-06 19:35:46 +0000
4@@ -16,7 +16,7 @@
5 print "using locale in source code folder"
6
7
8-parser = OptionParser()
9+parser = OptionParser(usage="%prog [-f] [-q]", version="%prog 1.0")
10 parser.add_option("-f", "--file", dest="filename",
11 help="write report to FILE", metavar="FILE")
12 parser.add_option("-q", "--quiet",
13
14=== modified file 'clicompanionlib/controller.py'
15--- clicompanionlib/controller.py 2011-04-02 22:50:51 +0000
16+++ clicompanionlib/controller.py 2011-06-06 19:35:46 +0000
17@@ -157,11 +157,14 @@
18 text3 = entry3.get_text()
19 '''open flat file, add the new command, update CMNDS variable
20 ## update commands in liststore (on screen) '''
21- with open(CHEATSHEET, "a") as cheatfile:
22- if text1 != "":
23- ## write new commands to .clicompanion2 file
24- cheatfile.write(text1+":"+text2+":"+text3+'\n')
25+ if text1 != "":
26+ with open(CHEATSHEET, "r") as cheatfile:
27+ cheatlines = cheatfile.readlines()
28+ cheatlines.append(text1+":"+text2+":"+text3+'\n')
29 cheatfile.close()
30+ with open(CHEATSHEET, "w") as cheatfile2:
31+ cheatfile2.writelines(cheatlines)
32+ cheatfile2.close()
33 l = str(text1+":"+text2+":"+text3)
34 #ls = l.split(':',2)
35 ## update view.CMNDS variable
36@@ -257,18 +260,22 @@
37 self.remove_command(widget, liststore)
38 '''open flat file, add the new command, update CMNDS variable
39 ## update commands in liststore (on screen) '''
40- with open(CHEATSHEET, "a") as cheatfile:
41- ## write new commands to .clicompanion2 file
42- cheatfile.write(text1+":"+text2+":"+text3+'\n')
43- cheatfile.close()
44- l = str(text1+":"+text2+":"+text3)
45- #ls = l.split(':',2)
46- ## update view.CMNDS variable
47- filteredcommandplus = text1, text2, text3
48- view.CMNDS.append(filteredcommandplus)
49- ## update the command list on screen
50- liststore.append([text1,text2,text3])
51-
52+
53+ with open(CHEATSHEET, "r") as cheatfile:
54+ cheatlines = cheatfile.readlines()
55+ cheatlines.append(text1+":"+text2+":"+text3+'\n')
56+ cheatfile.close()
57+ with open(CHEATSHEET, "w") as cheatfile2:
58+ cheatfile2.writelines(cheatlines)
59+ cheatfile2.close()
60+ l = str(text1+":"+text2+":"+text3)
61+ #ls = l.split(':',2)
62+ ## update view.CMNDS variable
63+ filteredcommandplus = text1, text2, text3
64+ view.CMNDS.append(filteredcommandplus)
65+ ## update the command list on screen
66+ liststore.append([text1,text2,text3])
67+
68 ## The destroy method must be called otherwise the 'Close' button will
69 ## not work.
70 dialog.destroy()

Subscribers

People subscribed via source and target branches