示例#1
0
 def ok(self):
     path = self.pathname
     if os.path.exists(path):
         answer = ask("Replace existing '%s'?" % os.path.basename(path))
         if answer <> "OK":
             return
     FileDialog.ok(self)
示例#2
0
	def ok(self):
		path = self.pathname
		if os.path.exists(path):
			answer = ask("Replace existing '%s'?" % os.path.basename(path))
			if answer <> "OK":
				return
		FileDialog.ok(self)
示例#3
0
文件: hshell.py 项目: wolmir/cristina
	def ask_save_progress(self):
		"""If there is unsaved game progress, ask the user whether to save it, and
		if the answer is yes, do so. Reports errors to the user. Raises Cancel if
		cancelled or an error occurred."""
		if self.game.game_needs_saving():
			resp = ask("Save game progress?", ["Yes", "No", "Cancel"])
			if resp == "Cancel":
				raise Cancel
			if resp == "Yes":
				self.save_game(prompt = True)
示例#4
0
    def ask_save_progress(self):
        """If there is unsaved game progress, ask the user whether to save it, and
		if the answer is yes, do so. Reports errors to the user. Raises Cancel if
		cancelled or an error occurred."""
        if self.game.game_needs_saving():
            resp = ask("Save game progress?", ["Yes", "No", "Cancel"])
            if resp == "Cancel":
                raise Cancel
            if resp == "Yes":
                self.save_game(prompt=True)
示例#5
0
	def ask_save_level(self):
		"""If there are unsaved changes to a level, ask the
		user whether to save it, and if the answer is yes, do so. Reports
		errors to the user. Raises Cancel if cancelled or an error occurred."""
		if self.game.level_needs_saving:
			resp = ask("Save changes to level?", ["Yes", "No", "Cancel"])
			if resp == "Cancel":
				raise Cancel
			if resp == "Yes":
				self.save_level_cmd()
示例#6
0
文件: hshell.py 项目: wolmir/cristina
	def ask_quit(self):
		"""Make sure user really wants quit the game. Raises Cancel if cancelled
		or an error occurred."""
		if not ask("Quit the game?") == "OK":
			raise Cancel
示例#7
0
    def ask_quit(self):
        """Make sure user really wants quit the game. Raises Cancel if cancelled
		or an error occurred."""
        if not ask("Quit the game?") == "OK":
            raise Cancel
示例#8
0
 def look_for_level_set(self, orig_path):
     name = os.path.basename(orig_path)
     prompt = "Can't find '%s'. Would you like to look for it?" % name
     if ask(prompt, ["Yes", "No"]) == "Yes":
         return look_for_file_or_directory(name)
示例#9
0
文件: hlgame.py 项目: wolmir/cristina
	def look_for_level_set(self, orig_path):
		name = os.path.basename(orig_path)
		prompt = "Can't find '%s'. Would you like to look for it?" % name
		if ask(prompt, ["Yes", "No"]) == "Yes":
			return look_for_file_or_directory(name)