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

« back to all changes in this revision

Viewing changes to www/apps/fileservice/action.py

  • Committer: mattgiuca
  • Date: 2008-01-18 01:07:48 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:244
interpret.py: Major refactor of CGI interpreter code. Still missing some
functionality but now buffers input correctly and can handle binary files.
Also code much more nicely separated.
    Note: May not present error message correctly any more (temp).

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
#       path:   The path to the file to be updated. Only one file may be
106
106
#               specified.
107
107
#
108
 
# action=svnpublish: Set the "published" flag on a file to True.
109
 
#       path:   The path to the file to be published. Can be specified
110
 
#               multiple times.
111
 
#
112
 
# action=svnunpublish: Set the "published" flag on a file to False.
113
 
#       path:   The path to the file to be unpublished. Can be specified
114
 
#               multiple times.
115
 
#
116
108
# action=svncommit: Commit a file(s) or directory(s) to the repository.
117
109
#       path:   The path to the file or directory to be committed. Can be
118
110
#               specified multiple times. Directories are committed
438
430
    except pysvn.ClientError:
439
431
        raise ActionError("One or more files could not be reverted")
440
432
 
441
 
def action_svnpublish(req, fields):
442
 
    """Sets svn property "ivle:published" on each file specified.
443
 
    Should only be called on directories (only effective on directories
444
 
    anyway).
445
 
 
446
 
    Reads fields: 'path'
447
 
    """
448
 
    paths = fields.getlist('path')
449
 
    paths = map(lambda path: actionpath_to_local(req, path), paths)
450
 
 
451
 
    try:
452
 
        for path in paths:
453
 
            # Note: Property value doesn't matter
454
 
            svnclient.propset("ivle:published", "", path, recurse=False)
455
 
    except pysvn.ClientError:
456
 
        raise ActionError("One or more files could not be updated")
457
 
 
458
 
def action_svnunpublish(req, fields):
459
 
    """Deletes svn property "ivle:published" on each file specified.
460
 
 
461
 
    Reads fields: 'path'
462
 
    """
463
 
    paths = fields.getlist('path')
464
 
    paths = map(lambda path: actionpath_to_local(req, path), paths)
465
 
 
466
 
    try:
467
 
        for path in paths:
468
 
            svnclient.propdel("ivle:published", path, recurse=False)
469
 
    except pysvn.ClientError:
470
 
        raise ActionError("One or more files could not be updated")
471
 
 
472
433
def action_svncommit(req, fields):
473
434
    """Performs a "svn commit" to each file specified.
474
435
 
499
460
    "svnadd" : action_svnadd,
500
461
    "svnupdate" : action_svnupdate,
501
462
    "svnrevert" : action_svnrevert,
502
 
    "svnpublish" : action_svnpublish,
503
 
    "svnunpublish" : action_svnunpublish,
504
463
    "svncommit" : action_svncommit,
505
464
}