Example #1
0
 def __copy_to_home_cb(self, menu_item):
     """Make a local copy of the activity bundle in user_activities_path"""
     user_activities_path = get_user_activities_path()
     nick = customizebundle.generate_unique_id()
     new_basename = "%s_copy_of_%s" % (nick, os.path.basename(self._document_path))
     if not os.path.exists(os.path.join(user_activities_path, new_basename)):
         shutil.copytree(self._document_path, os.path.join(user_activities_path, new_basename), symlinks=True)
         customizebundle.generate_bundle(nick, new_basename)
     else:
         _logger.debug("%s already exists", new_basename)
Example #2
0
 def __copy_to_home_cb(self, menu_item):
     """Make a local copy of the activity bundle in user_activities_path"""
     user_activities_path = get_user_activities_path()
     nick = customizebundle.generate_unique_id()
     new_basename = '%s_copy_of_%s' % (
         nick, os.path.basename(self._document_path))
     if not os.path.exists(os.path.join(user_activities_path,
                                        new_basename)):
         shutil.copytree(self._document_path,
                         os.path.join(user_activities_path, new_basename),
                         symlinks=True)
         customizebundle.generate_bundle(nick, new_basename)
     else:
         _logger.debug('%s already exists', new_basename)
Example #3
0
            def async_copy_activity_tree():
                try:
                    shutil.copytree(self._document_path,
                                    os.path.join(user_activities_path,
                                                 new_basename),
                                    symlinks=True)
                    customizebundle.generate_bundle(nick, new_basename)

                    if copy_alert:
                        self.get_toplevel().remove_alert(copy_alert)

                    alert = NotifyAlert(10)
                    alert.props.title = _('Duplicated')
                    alert.props.msg = _('The activity has been duplicated')
                    alert.connect('response', self.__alert_response_cb)
                    self.get_toplevel().add_alert(alert)
                finally:
                    self.__set_busy_cursor(False)
Example #4
0
            def async_copy_activity_tree():
                try:
                    shutil.copytree(self._document_path,
                                    os.path.join(
                                        user_activities_path,
                                        new_basename),
                                    symlinks=True)
                    customizebundle.generate_bundle(nick, new_basename)

                    if copy_alert:
                        self.get_toplevel().remove_alert(copy_alert)

                    alert = NotifyAlert(10)
                    alert.props.title = _('Duplicated')
                    alert.props.msg = _('The activity has been duplicated')
                    alert.connect('response', self.__alert_response_cb)
                    self.get_toplevel().add_alert(alert)
                finally:
                    self.__set_busy_cursor(False)