Merge lp:~trent-trentonadams/backintime/human-readable into lp:backintime/1.0

Proposed by Trenton D. Adams
Status: Rejected
Rejected by: Germar
Proposed branch: lp:~trent-trentonadams/backintime/human-readable
Merge into: lp:backintime/1.0
Diff against target: 125 lines (+35/-1)
5 files modified
common/config.py (+6/-0)
common/tools.py (+3/-0)
gnome/settingsdialog.glade (+14/-1)
gnome/settingsdialog.py (+7/-0)
kde4/settingsdialog.py (+5/-0)
To merge this branch: bzr merge lp:~trent-trentonadams/backintime/human-readable
Reviewer Review Type Date Requested Status
Germar Disapprove
Review via email: mp+60450@code.launchpad.net

Description of the change

I've added rsync --human-readable support

- modified gnome and kde applications to set the configuration
- tested both gnome and kde applications, making sure they can toggle human_readable flag in ~/.config/backintime/config
- backup runs with --human-readable.

I think this is a simple enough change to consider it "stable".

I wanted this feature so that when I twitter the summary of how much data was transferred, it is easily readable.

For example, now I get this...
sent 150.30M bytes received 2.62M bytes 719.59K bytes/sec

Instead of something like this...
sent 150123456 bytes received 2621325 bytes 719591 bytes/sec

I grab the 150M awk, and send that value out with my tweet.

To post a comment you must log in.
782. By Trenton D. Adams

- oops, removed use_checksum capability by accident

783. By Trenton D. Adams

- and apparently they use tabs

Revision history for this message
Trenton D. Adams (trent-trentonadams) wrote :

oops, I accidentally messed up the kde app by removing checksum capability. Should I cancel this merge request, and make a new one?

Revision history for this message
Germar (germar) wrote :

Thanks for the code and sorry it took that long before someone looked at it. I added -h flag (same as --human-readable) permanently for next major version 1.0. So this is obsolete by now.

review: Disapprove

Unmerged revisions

783. By Trenton D. Adams

- and apparently they use tabs

782. By Trenton D. Adams

- oops, removed use_checksum capability by accident

781. By Trenton D. Adams

- add --human-readable support for kde app

780. By Trenton D. Adams

- add rsync --human-readable support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'common/config.py'
2--- common/config.py 2011-01-05 20:09:02 +0000
3+++ common/config.py 2011-05-12 04:41:10 +0000
4@@ -641,6 +641,12 @@
5 def set_use_checksum( self, value, profile_id = None ):
6 return self.set_profile_bool_value( 'snapshots.use_checksum', value, profile_id )
7
8+ def human_readable( self, profile_id = None ):
9+ return self.get_profile_bool_value( 'snapshots.human_readable', False, profile_id )
10+
11+ def set_human_readable( self, value, profile_id = None ):
12+ return self.set_profile_bool_value( 'snapshots.human_readable', value, profile_id )
13+
14 def log_level( self, profile_id = None ):
15 return self.get_profile_int_value( 'snapshots.log_level', 3, profile_id )
16
17
18=== modified file 'common/tools.py'
19--- common/tools.py 2010-11-16 20:32:10 +0000
20+++ common/tools.py 2011-05-12 04:41:10 +0000
21@@ -348,6 +348,9 @@
22 if config.use_checksum():
23 cmd = cmd + ' --checksum'
24
25+ if config.human_readable():
26+ cmd = cmd + ' --human-readable'
27+
28 if config.copy_unsafe_links():
29 cmd = cmd + ' --copy-unsafe-links'
30
31
32=== modified file 'gnome/settingsdialog.glade'
33--- gnome/settingsdialog.glade 2011-02-13 21:10:04 +0000
34+++ gnome/settingsdialog.glade 2011-05-12 04:41:10 +0000
35@@ -1011,6 +1011,19 @@
36 </packing>
37 </child>
38 <child>
39+ <object class="GtkCheckButton" id="cb_human_readable">
40+ <property name="label" translatable="yes">Output numbers in human readable format</property>
41+ <property name="visible">True</property>
42+ <property name="can_focus">True</property>
43+ <property name="receives_default">False</property>
44+ <property name="draw_indicator">True</property>
45+ </object>
46+ <packing>
47+ <property name="expand">False</property>
48+ <property name="position">5</property>
49+ </packing>
50+ </child>
51+ <child>
52 <object class="GtkHBox" id="hbox9">
53 <property name="visible">True</property>
54 <property name="spacing">5</property>
55@@ -1035,7 +1048,7 @@
56 </object>
57 <packing>
58 <property name="expand">False</property>
59- <property name="position">5</property>
60+ <property name="position">6</property>
61 </packing>
62 </child>
63 <child>
64
65=== modified file 'gnome/settingsdialog.py'
66--- gnome/settingsdialog.py 2010-11-02 20:51:40 +0000
67+++ gnome/settingsdialog.py 2011-05-12 04:41:10 +0000
68@@ -254,6 +254,9 @@
69 self.cb_use_gloobus_preview.set_active( self.config.get_bool_value( 'gnome.use_gloobus_preview', True ) )
70 self.cb_use_checksum = get( 'cb_use_checksum' )
71
72+ #enable human readable format
73+ self.cb_human_readable= get( 'cb_human_readable' )
74+
75 #log level
76 self.store_log_level = gtk.ListStore( int, str )
77 self.combo_log_level = get( 'combo_log_level' )
78@@ -493,6 +496,9 @@
79 #use checksum
80 self.cb_use_checksum.set_active( self.config.use_checksum( self.profile_id ) )
81
82+ #human readable format
83+ self.cb_human_readable.set_active( self.config.human_readable( self.profile_id ) )
84+
85 #log level
86 self.combo_log_level.set_active( self.config.log_level( self.profile_id ) )
87
88@@ -586,6 +592,7 @@
89 self.config.set_backup_on_restore( self.cb_backup_on_restore.get_active(), self.profile_id )
90 self.config.set_continue_on_errors( self.cb_continue_on_errors.get_active(), self.profile_id )
91 self.config.set_use_checksum( self.cb_use_checksum.get_active(), self.profile_id )
92+ self.config.set_human_readable( self.cb_human_readable.get_active(), self.profile_id )
93 self.config.set_log_level( self.store_log_level.get_value( self.combo_log_level.get_active_iter(), 0 ), self.profile_id )
94
95 #expert options
96
97=== modified file 'kde4/settingsdialog.py'
98--- kde4/settingsdialog.py 2011-02-13 21:10:04 +0000
99+++ kde4/settingsdialog.py 2011-05-12 04:41:10 +0000
100@@ -352,6 +352,9 @@
101 self.cb_use_checksum = QCheckBox( QString.fromUtf8( _( 'Use checksum to detect changes' ) ), self )
102 layout.addWidget( self.cb_use_checksum )
103
104+ self.cb_human_readable = QCheckBox( QString.fromUtf8( _( 'Output numbers in human readable format' ) ), self )
105+ layout.addWidget( self.cb_human_readable)
106+
107 #log level
108 hlayout = QHBoxLayout()
109 layout.addLayout( hlayout )
110@@ -557,6 +560,7 @@
111 self.cb_backup_on_restore.setChecked( self.config.is_backup_on_restore_enabled() )
112 self.cb_continue_on_errors.setChecked( self.config.continue_on_errors() )
113 self.cb_use_checksum.setChecked( self.config.use_checksum() )
114+ self.cb_human_readable.setChecked( self.config.human_readable() )
115 self.set_combo_value( self.combo_log_level, self.config.log_level() )
116
117 #TAB: Expert Options
118@@ -626,6 +630,7 @@
119 self.config.set_backup_on_restore( self.cb_backup_on_restore.isChecked() )
120 self.config.set_continue_on_errors( self.cb_continue_on_errors.isChecked() )
121 self.config.set_use_checksum( self.cb_use_checksum.isChecked() )
122+ self.config.set_human_readable( self.cb_human_readable.isChecked() )
123 self.config.set_log_level( self.combo_log_level.itemData( self.combo_log_level.currentIndex() ).toInt()[0] )
124
125 #expert options

Subscribers

People subscribed via source and target branches