Ejemplo n.º 1
0
    def save_target(self):
        target_file = tkFileDialog.asksaveasfilename(
            defaultextension=".target",
            filetypes=[("ShootOFF Target", ".target")],
            initialdir="targets/",
            title="Save ShootOFF Target",
            parent=self._window,
        )

        if target_file and not os.path.isfile(target_file):
            self._notify_new_target(target_file)

        if target_file:
            target_pickler = TargetPickler()
            target_pickler.save(target_file, self._regions, self._target_canvas)
Ejemplo n.º 2
0
    def save_target(self):
        target_file = tkFileDialog.asksaveasfilename(
            defaultextension=".target",
            filetypes=[("ShootOFF Target", ".target")],
            initialdir="targets/",
            title="Save ShootOFF Target",
            parent=self._window)

        if (target_file and not os.path.isfile(target_file)):
            self._notify_new_target(target_file)

        if target_file:
            target_pickler = TargetPickler()
            target_pickler.save(target_file, self._regions,
                                self._target_canvas)
Ejemplo n.º 3
0
    def save_target(self):
        is_animated = self._canvas_manager.is_animated(self._regions)
        if is_animated:
            initdir = "animated_targets/"
        else:
            initdir = "targets/"

        target_file = tkFileDialog.asksaveasfilename(
            defaultextension=".target",
            filetypes=[("ShootOFF Target", ".target")],
            initialdir=initdir,
            title="Save ShootOFF Target",
            parent=self._window)

        is_new_target = target_file and not os.path.isfile(target_file)

        if target_file:
            target_pickler = TargetPickler()
            target_pickler.save(target_file, self._regions,
                self._target_canvas)

        if (is_new_target):
            self._notify_new_target(target_file, is_animated)