Performs an archive action on the todolist.

        This means that all completed tasks are moved to the archive file
        (defaults to done.txt).
160190
def _archive(self):
        
        archive, archive_file = _retrieve_archive()

        if self.backup:
            self.backup.add_archive(archive)

        if archive:
            from topydo.commands.ArchiveCommand import ArchiveCommand
            command = ArchiveCommand(self.todolist, archive)
            command.execute()

            if archive.dirty:
                archive_file.write(archive.print_todos())
601968
def perform(action, options = {})
      return unless %i[
        backtrace
        down
        finish
        frame
        next
        step
        up
      ].include?(action)

      send("perform_#{action}", options)
    end
246638
def do(self, changes, task_handle=taskhandle.NullTaskHandle()):
        
        self.history.do(changes, task_handle=task_handle)
1244420
function taskComplete() {
  winston.info(_pkgname + "task done #"+this.id + ' [' + this.data.id + ']');
  // now instantiate the next set of tasks
  //issueJobsNextLevel(this.data.jobname, this, this.data.flow);
  if(this.data._done) {
    this.data._done(this);
  }
}
326476
synchronized public void completeTask(int taskId, int partitionStoresMigrated) {
        tasksInFlight.remove(taskId);

        numTasksCompleted++;
        numPartitionStoresMigrated += partitionStoresMigrated;

        updateProgressBar();
    }
868054
def move_file(self, src, dst):
        

        src = self.get_full_file_path(src); dst = self.get_full_file_path(dst)

        # record where file moved
        if os.path.isfile(src):
            # if destination file exists, copy it to tmp first
            if os.path.isfile(dst):
                tmp_path = self.new_tmp()
                self.do_action({
                    'do'   : ['copy', dst, tmp_path],
                    'undo' : ['move', tmp_path, dst]})

        self.do_action(
            {'do'   : ['move', src, dst],
             'undo' : ['move', dst, src]})
855115
async function archiveWorkingDir(dirPath, archive) {
  // recursively collect all entries (files and directories)
  const allEntries = await collectFSEntries(dirPath, []);

  const process = (entry, cb) => {
    const p = relativePaths(dirPath, entry.path);
    if (p.length) {
      if (entry.stats.isDirectory()) {
        archive.append(null, { name: `${p}/` });
      } else {
        archive.append(fse.createReadStream(entry.path), { name: p });
      }
    }
    cb();
  };

  return new Promise((resolve, reject) => {
    async.eachSeries(
      allEntries,
      process,
      (err) => {
        if (err) {
          reject(err);
        } else {
          resolve(archive);
        }
      },
    );
  });
}
512317
def post_save(self):
        """"""
        if self.run:
            self.run = False
            self.create_tasks()
            self.save()
365298
def execute(self):
        
        last_operation = len(self._operations) - 1
        for i, operation in enumerate(self._operations):
            command = self._cmd(operation)

            if command.execute() is False:
                return False
            else:
                action = command.execute_post_archive_actions
                self._post_archive_actions.append(action)

                if i == last_operation:
                    return True
534401
def next_task(self, item, raise_exceptions=None, **kwargs):
        
        filename = os.path.basename(item)
        batch = self.get_batch(filename)
        tx_deserializer = self.tx_deserializer_cls(
            allow_self=self.allow_self, override_role=self.override_role
        )
        try:
            tx_deserializer.deserialize_transactions(
                transactions=batch.saved_transactions
            )
        except (DeserializationError, TransactionDeserializerError) as e:
            raise TransactionsFileQueueError(e) from e
        else:
            batch.close()
            self.archive(filename)
494510
def _load_file(self):
        
        self.todolist.erase()
        self.todolist.add_list(self.todofile.read())
        self.completer = PromptCompleter(self.todolist)
1346753
function todolist(node)
{
  /* scope `this` for events to access data set */
  var self = this;
  
  /* ATTRIBUTES */
  
  /* where each added item is stored, when this changes based on items the html list of todolist_items will change */
  this.items = [];
  
  /* the amount of completed tasks */
  this.complete = 0;
  
  /* the total number of tasks */
  this.total = 0;
  
  /* current input text */
  this.text = "";
  
  /* ERRORS */
  
  /* whether to show an error or not */
  this.isError = false;
  
  /* the message for this error */
  this.error = "";
  
  /* EVENTS */
  
  /* each sort button fires this */
  this.onSort = function(sorter)
  {
    /* we want to distinguish the from the rest as they are always active */
    var sorts = ['Descending','Ascending'];
    
    /* loop through sorters array */
    for(var x=0,len=self.sorters.length;x<len;x++)
    {
      /* check if Descending or Ascending sort method, if not then say if this sorter has been clicked or not, reset all others */
      if(sorts.indexOf(sorter) === -1 && sorts.indexOf(self.sorters[x].title) === -1)
      {
        self.sorters[x].active = (self.sorters[x].title === sorter);
      }
      
      /* if Descending or Ascending was clicked, check between them which is active */
      else if(sorts.indexOf(sorter) !== -1 && sorts.indexOf(self.sorters[x].title) !== -1)
      {
        self.sorters[x].active = (self.sorters[x].title === sorter);
      }
    }
    
    /* this runs the main sorting method, You will find these attached to prototype at the bottom of the page, based on sorter text clicked */
    self[sorter](self.items);
  }
  
  /* this input keyup fires this */
  this.onAdd = function(e)
  {
    /* keycode that was clicked */
    var keyCode = (e.which || e.keyCode),
        
        /* a list of just the titles of the items */
        itemtitles = self.items.map(function(item){return item.title;});
    
    /* reset error so it will no longer show */
    self.isError = false;
    
    /* if the key pressed was 'enter' key */
    if(keyCode === 13)
    {
      /* check if entered text doesnt already exist in the list, if it does throw an error */
      if(itemtitles.indexOf(self.text) !== -1)
      {
        self.isError = true;
        self.error = "This already exists!";
      }
      
      /* if no error push new item into the items array */
      if(!self.isError)
      {
        /* these will be all passed properties to the todolist_items component */
        self.items.push({
          title:self.text,
          hide:false,
          complete:false,
          favorite:false,
          onComplete:self.onComplete,
          onDelete:self.onDelete
        });
        
        /* increment total */
        self.total += 1;
        
        /* reset input */
        self.text = "";
      }
    }
  }
  
  /* passed to each todolist_items component to fire when a checkbox is clicked */
  this.onComplete = function(v)
  {
    /* if checkbox is active we add one else we subtract one */
    self.complete += ((typeof v === 'string' ? (v === 'true') : !!v) ? 1 : -1);
  }
  
  /* passed to each todolist_items component to fire when the trashcan is clicked */
  this.onDelete = function(title)
  {
    /* get the index of this item */
    var id = self.items.map(function(item){return item.title;}).indexOf(title);
    
    /* if this item was completed, subtract complete */
    if((typeof self.items[id].complete === 'string' ? (self.items[id].complete === 'true') : !!self.items[id].complete)) self.complete -= 1;
    
    /* delete the item from the array, splice also works, del is just shorter */
    self.items.del(id);
    
    /* subtract from total # of todo tasks */
    self.total -= 1;
  }
  
  /* the sorting items, array with data that is used to create the sortitems looped components, onSort method is passed to be used when user clicks each item */
  this.sorters = [
    {title:'All',active:true,onSort:this.onSort},
    {title:'Todo',active:false,onSort:this.onSort},
    {title:'Completed',active:false,onSort:this.onSort},
    {title:'Favorites',active:false,onSort:this.onSort},
    {title:'Ascending',active:false,onSort:this.onSort},
    {title:'Descending',active:false,onSort:this.onSort}
  ];
  
  /* a simple filter to change the css so that the error is not shown when !isError */
  this.filters.toDisplay = function(v)
  {
    return (!v ? 'none' : 'inherit');
  }
  
  
  this.completeclick = function()
  {
    self.getdata();
  }
}
1337610
@Override
    public void doExecute() {
        if (!getEditor().isReadOnly()) {
            deleted = getEditor().delete().charAt(0);
            getEditor().put(replace);
            getEditor().moveLeft(replace.length());
        }
    }
226866
def archive_all_files(self, archiver):
        
        for file_path in self.extra:
            archiver(path.abspath(file_path), path.join(self.prefix, file_path))

        for file_path in self.walk_git_files():
            archiver(path.join(self.main_repo_abspath, file_path), path.join(self.prefix, file_path))
1052836
def on_created(self, event, dry_run=False, remove_uploaded=True):
        ' '
        super(ArchiveEventHandler, self).on_created(event)
        log.info("created: %s", event)
112571
function() {
            this.options.route = 'done';
            this.options.collection = new TodoList(todos.done());
            this.options.toggleItem = _.bind(this.toggleItem, this);
            this.options.refreshModel = _.bind(this.refreshModel, this);
        }
1314377
@Override
    void archive() {
        FTPArchiveClient client = new FTPArchiveClient();
        try {
            client.init(clientArguments);
        } catch (UnknownHostException e) {
            throw new Audit4jRuntimeException("Excepting in running archive client.", e);
        }
    }