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

« back to all changes in this revision

Viewing changes to lib/fileservice_lib/action.py

  • Committer: mattgiuca
  • Date: 2008-06-23 11:38:50 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:788
fileservice_lib: Fixed and made consistent the error message if a file already
    exists, across all actions. (Previously 3 different messages).

Show diffs side-by-side

added added

removed removed

Lines of Context:
239
239
    if os.path.exists(topath):
240
240
        if frompath == topath:
241
241
            raise ActionError("Source and destination are the same")
242
 
        raise ActionError("Another file already exists with that name")
 
242
        raise ActionError("A file already exists with that name")
243
243
 
244
244
    try:
245
245
        if copy:
303
303
        raise ActionError("Required field missing")
304
304
    path = actionpath_to_local(req, path)
305
305
 
 
306
    if os.path.exists(path):
 
307
        raise ActionError("A file already exists with that name")
 
308
 
306
309
    # Create the directory
307
310
    try:
308
311
        os.mkdir(path)
338
341
 
339
342
    if not overwrite:
340
343
        if os.path.exists(path):
341
 
            raise ActionError("A file with that name already exists")
 
344
            raise ActionError("A file already exists with that name")
342
345
 
343
346
    # Copy the contents of file object 'data' to the path 'path'
344
347
    try: