Package pyanaconda :: Package textw :: Module constants_text
[hide private]
[frames] | no frames]

Source Code for Module pyanaconda.textw.constants_text

 1  # 
 2  # constants_text.py: text mode constants 
 3  # 
 4  # Copyright (C) 2000, 2001, 2002  Red Hat, Inc.  All rights reserved. 
 5  # 
 6  # This program is free software; you can redistribute it and/or modify 
 7  # it under the terms of the GNU General Public License as published by 
 8  # the Free Software Foundation; either version 2 of the License, or 
 9  # (at your option) any later version. 
10  # 
11  # This program is distributed in the hope that it will be useful, 
12  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
13  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
14  # GNU General Public License for more details. 
15  # 
16  # You should have received a copy of the GNU General Public License 
17  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
18  # 
19   
20  from pyanaconda.constants import * 
21  import gettext 
22  _ = lambda x: gettext.ldgettext("anaconda", x) 
23   
24  INSTALL_OK = 0 
25  INSTALL_BACK = -1 
26  INSTALL_NOOP = -2 
27   
28 -class Translator:
29 """A simple class to facilitate on-the-fly translation for newt buttons"""
30 - def __init__(self, button, check):
31 self.button = button 32 self.check = check
33
34 - def __getitem__(self, which):
35 if which == 0: 36 return _(self.button) 37 elif which == 1: 38 return self.check 39 raise IndexError
40
41 - def __len__(self):
42 return 2
43 44 TEXT_OK_STR = N_("OK") 45 TEXT_OK_CHECK = "ok" 46 TEXT_OK_BUTTON = Translator(TEXT_OK_STR, TEXT_OK_CHECK) 47 48 TEXT_CANCEL_STR = N_("Cancel") 49 TEXT_CANCEL_CHECK = "cancel" 50 TEXT_CANCEL_BUTTON = Translator(TEXT_CANCEL_STR, TEXT_CANCEL_CHECK) 51 52 TEXT_BACK_STR = N_("Back") 53 TEXT_BACK_CHECK = "back" 54 TEXT_BACK_BUTTON = Translator(TEXT_BACK_STR, TEXT_BACK_CHECK) 55 56 TEXT_YES_STR = N_("Yes") 57 TEXT_YES_CHECK = "yes" 58 TEXT_YES_BUTTON = Translator(TEXT_YES_STR, TEXT_YES_CHECK) 59 60 TEXT_NO_STR = N_("No") 61 TEXT_NO_CHECK = "no" 62 TEXT_NO_BUTTON = Translator(TEXT_NO_STR, TEXT_NO_CHECK) 63 64 TEXT_EDIT_STR = N_("Edit") 65 TEXT_EDIT_CHECK = "edit" 66 TEXT_EDIT_BUTTON = Translator(TEXT_EDIT_STR, TEXT_EDIT_CHECK) 67 68 TEXT_RETRY_STR = N_("Retry") 69 TEXT_RETRY_CHECK = "retry" 70 TEXT_RETRY_BUTTON = Translator(TEXT_RETRY_STR, TEXT_RETRY_CHECK) 71 72 TEXT_F12_CHECK = "F12" 73 74 TEXT_REINITIALIZE = _( 75 """This storage device may contain data: 76 77 %(description)s, %(size)s MB, %(devicePath)s 78 79 We could not detect partitions or filesystems on this device. This could be \ 80 because the device is blank, unpartitioned, or virtual. If not, there may be \ 81 data on the device that can not be recovered if you use it in this \ 82 installation. We can remove the device from this installation to protect the \ 83 data. 84 85 Are you sure this device does not contain valuable data?""") 86 87 TEXT_REINITIALIZE_ALL = _(\ 88 "Apply my choice to all devices with undetected partitions.") 89