~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to lib/fileservice_lib/action.py

  • Committer: wagrant
  • Date: 2008-07-21 06:26:27 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:921
fileservice_lib, browser: Rename the old remove action to delete, to
      make room for our new svn remove action, which was just added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
256
256
 
257
257
### ACTIONS ###
258
258
 
259
 
def action_remove(req, fields):
260
 
    # TODO: Do an SVN rm if the file is versioned.
 
259
def action_delete(req, fields):
261
260
    # TODO: Disallow removal of student's home directory
262
261
    """Removes a list of files or directories.
263
262
 
541
540
    except pysvn.ClientError, e:
542
541
        raise ActionError(str(e))
543
542
 
 
543
def action_svnremove(req, fields):
 
544
    """Performs a "svn remove" on each file specified.
 
545
 
 
546
    Reads fields: 'path' (multiple)
 
547
    """
 
548
    paths = fields.getlist('path')
 
549
    paths = map(lambda path: actionpath_to_local(req, path), paths)
 
550
 
 
551
    try:
 
552
        svnclient.remove(paths, force=True)
 
553
    except pysvn.ClientError, e:
 
554
        raise ActionError(str(e))
 
555
 
544
556
def action_svnupdate(req, fields):
545
557
    """Performs a "svn update" to each file specified.
546
558
 
659
671
# Each function has the interface f(req, fields).
660
672
 
661
673
actions_table = {
662
 
    "remove" : action_remove,
 
674
    "delete" : action_delete,
663
675
    "move" : action_move,
664
676
    "mkdir" : action_mkdir,
665
677
    "putfile" : action_putfile,
669
681
    "unpublish" : action_unpublish,
670
682
 
671
683
    "svnadd" : action_svnadd,
 
684
    "svnremove" : action_svnremove,
672
685
    "svnupdate" : action_svnupdate,
673
686
    "svnresolved" : action_svnresolved,
674
687
    "svnrevert" : action_svnrevert,