Mon Sep 26 17:39:24 PDT 2005

svn: r5238
This commit is contained in:
Alex Roitman 2005-09-27 00:39:25 +00:00
parent cfb69f9e5a
commit e2011abfd4

View File

@ -67,6 +67,50 @@ cust_ret_list = [
'cvs up', 'cvs up',
] ]
#-------------------------------------------------------------------------
#
# Some message strings
#
#-------------------------------------------------------------------------
rcs_setup_failure_msg = [
_("Checkpoint Archive Creation Failed"),
_("No checkpointing archive was found. "
"An attempt to create it has failed with the "
"following message:\n\n%s")
]
rcs_setup_success_msg = [
_("Checkpoint Archive Created"),
_("No checkpointing archive was found, "
"so it was created to enable archiving.\n\n"
"The archive file name is %s\n"
"Deleting this file will lose the archive "
"and make impossible to extract archived data "
"from it.")
]
archive_failure_msg = [
_("Checkpoint Failed"),
_("An attempt to archive the data failed "
"with the following message:\n\n%s")
]
archive_success_msg = [
_("Checkpoint Succeeded "),
_("The data was successfully archived.")
]
retrieve_failure_msg = [
_("Checkpoint Failed"),
_("An attempt to retrieve the data failed "
"with the following message:\n\n%s")
]
retrieve_success_msg = [
_("Checkpoint Succeeded "),
_("The data was successfully retrieved.")
]
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -264,30 +308,22 @@ class Checkpoint(Tool.Tool):
del proc del proc
if status: if status:
msg1 = _("Checkpoint Archive Creation Failed") msg1 = rcs_setup_failure_msg[0]
msg2 = _("No checkpointing archive was found. " msg2 = rcs_setup_failure_msg[1] % message
"An attempt to create it has failed with the " dialog = ErrorDialog
"following message:\n\n%s") % message
if cli:
print msg1
print msg2
else:
ErrorDialog(msg1,msg2)
return
else: else:
msg1 = _("Checkpoint Archive Created") msg1 = rcs_setup_success_msg[0]
msg2 = _("No checkpointing archive was found, " msg2 = rcs_setup_success_msg[1] % archive
"so it was created to enable archiving.\n\n" dialog = OkDialog
"The archive file name is %s\n"
"Deleting this file will lose the archive " if cli:
"and make impossible to extract archived data " print msg1
"from it.") % archive print msg2
if cli: else:
print msg1 dialog(msg1,msg2)
print msg2
else: if status:
OkDialog(msg1,msg2) return
if checkin: if checkin:
# At this point, we have an existing archive file # At this point, we have an existing archive file
@ -300,23 +336,21 @@ class Checkpoint(Tool.Tool):
status = proc.wait() status = proc.wait()
message = "\n".join(proc.childerr.readlines()) message = "\n".join(proc.childerr.readlines())
del proc del proc
if status: if status:
msg1 = _("Checkpoint Failed") msg1 = archive_failure_msg[0]
msg2 = _("An attempt to archive the data failed " msg2 = archive_failure_msg[1] % message
"with the following message:\n\n%s") % message dialog = ErrorDialog
if cli:
print msg1
print msg2
else:
ErrorDialog(msg1,msg2)
else: else:
msg1 = _("Checkpoint Succeeded ") msg1 = archive_success_msg[0]
msg2 = _("The data was successfully archived.") msg2 = archive_success_msg[1]
if cli: dialog = OkDialog
print msg1
print msg2 if cli:
else: print msg1
OkDialog(msg1,msg2) print msg2
else:
dialog(msg1,msg2)
else: else:
proc = popen2.Popen3("co -p %s > %s.gramps" proc = popen2.Popen3("co -p %s > %s.gramps"
% (archive_base,archive_base), % (archive_base,archive_base),
@ -326,22 +360,19 @@ class Checkpoint(Tool.Tool):
message = "\n".join(proc.childerr.readlines()) message = "\n".join(proc.childerr.readlines())
del proc del proc
if status: if status:
msg1 = _("Checkpoint Failed") msg1 = retrieve_failure_msg[0]
msg2 = _("An attempt to retrieve the data failed " msg2 = retrieve_failure_msg[1] % message
"with the following message:\n\n%s") % message dialog = ErrorDialog
if cli:
print msg1
print msg2
else:
ErrorDialog(msg1,msg2)
else: else:
msg1 = _("Checkpoint Succeeded ") msg1 = retrieve_success_msg[0]
msg2 = _("The data was successfully retrieved.") msg2 = retrieve_success_msg[1]
if cli: dialog = OkDialog
print msg1
print msg2 if cli:
else: print msg1
OkDialog(msg1,msg2) print msg2
else:
dialog(msg1,msg2)
def callback(self,value): def callback(self,value):
""" """