/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/backend/fileops.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-08-09 14:08:12 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060809140812-d66e04a7c2899eee
Implemented Move functionality; move() backend code refined.

2006-08-09  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/frontend/gtk/move.py: implemented OliveMove
    * olive/frontend/gtk/handler.py: added Move signal handler
    * olive.glade: added Move dialog
    * olive/backend/errors.py: added NotSameBranchError
    * olive/backend/fileops.py: added NotBranchError and NotSameBranchError
      support to move()

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
from errors import (DirectoryAlreadyExists, MissingArgumentError,
24
24
                    MultipleMoveError, NoFilesSpecified, NoMatchingFiles,
25
 
                    NonExistingSource, NotBranchError, NotVersionedError)
 
25
                    NonExistingSource, NotBranchError, NotSameBranchError,
 
26
                    NotVersionedError)
26
27
 
27
28
def add(file_list, recursive=False):
28
29
    """ Add listed files to the branch. 
77
78
    
78
79
    if len(names_list) < 2:
79
80
        raise MissingArgumentError
80
 
    tree, rel_names = tree_files(names_list)
 
81
    
 
82
    try:
 
83
        tree, rel_names = tree_files(names_list)
 
84
    except errors.NotBranchError:
 
85
        raise NotBranchError
 
86
    except errors.BzrCommandError:
 
87
        # not the same branch presumably
 
88
        raise NotSameBranchError
81
89
        
82
90
    if os.path.isdir(names_list[-1]):
83
91
        # move into existing directory