~ryan-c-ahearn/backintime/command_line_interface

« back to all changes in this revision

Viewing changes to cli/copywidget.py

  • Committer: Ryan Ahearn
  • Date: 2010-03-02 04:48:25 UTC
  • Revision ID: ryan.c.ahearn@gmail.com-20100302044825-4efo4lqb7b5pjzwa
Added gettext calls to all strings that will be displayed to the user

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import os.path
20
20
import shutil
21
21
import urwid
 
22
import gettext
22
23
 
23
24
import logger
24
25
import restorewidget
25
26
 
 
27
_=gettext.gettext
 
28
 
26
29
class CopyWidget(urwid.WidgetWrap):
27
30
 
28
31
    def __init__( self, main_win, config, to_copy ):
30
33
        self._config = config
31
34
        self._to_copy = to_copy
32
35
 
33
 
        self._edit_box = urwid.Edit(( 'body', 'Enter destination: ' ))
 
36
        self._edit_box = urwid.Edit(( 'body', _('Enter destination') + ': ' ))
34
37
        pile_list = [
35
38
            urwid.AttrWrap( self._edit_box, 'edit_box', 'edit_focus' ),
36
39
            urwid.Divider(),
37
40
            urwid.GridFlow( [
38
 
                urwid.AttrWrap( urwid.Button( 'OK', self.ok_pressed ), 'button', 'button_focus' ),
39
 
                urwid.AttrWrap( urwid.Button( 'Cancel', self.go_home ), 'button', 'button_focus' )
 
41
                urwid.AttrWrap( urwid.Button( _('OK'), self.ok_pressed ), 'button', 'button_focus' ),
 
42
                urwid.AttrWrap( urwid.Button( _('Cancel'), self.go_home ), 'button', 'button_focus' )
40
43
                ], 10, 2, 1, 'right' )
41
44
            ]
42
45
 
45
48
 
46
49
    def ok_pressed( self, button ):
47
50
        destination = self._edit_box.get_edit_text().strip()
48
 
        logger.info( 'RCA copying %s to %s' % ( self._to_copy, destination ) )
 
51
        logger.info( 'copying %s to %s' % ( self._to_copy, destination ) )
49
52
        if os.path.isdir( self._to_copy ):
50
53
            self._copy_directory( destination )
51
54
        else: