Browse Source

Strip trailing whitespaces

Matteo Cypriani 11 months ago
parent
commit
67469febfb
4 changed files with 27 additions and 27 deletions
  1. 3
    3
      CHANGELOG
  2. 1
    1
      README
  3. 19
    19
      gcp
  4. 4
    4
      test_gcp.py

+ 3
- 3
CHANGELOG View File

@@ -1,7 +1,7 @@
1 1
 gcp 0.1.3 (20/06/11):
2 2
 	- fixed exit status
3 3
 	- updated manpage with exit status
4
-	- gcp DIR1 DIR2 syntax fixed	
4
+	- gcp DIR1 DIR2 syntax fixed
5 5
 	- tests
6 6
 gcp 0.1.2 (16/06/11):
7 7
 	- removed bad fd close
@@ -10,12 +10,12 @@ gcp 0.1.2 (16/06/11):
10 10
 	- unaccessible source dir crash fix
11 11
 	- os.stat precision fix
12 12
 	- manpage
13
-	- install script 
13
+	- install script
14 14
 gcp 0.1.1 (30/09/10):
15 15
 	- double entry check in journal
16 16
 	- unicode source_path send via dbus (second instance of gcp) fixed
17 17
 	- errors are now shown after copy
18 18
 	- fixed bad closure when a file already exists
19
-	- added "gcp SOURCE_FILE DEST_FILE" syntax management 
19
+	- added "gcp SOURCE_FILE DEST_FILE" syntax management
20 20
 gcp 0.1 (28/09/10):
21 21
 	**INITIAL PUBLIC RELEASE**

+ 1
- 1
README View File

@@ -35,7 +35,7 @@ gcp is a file copier, loosely inspired from cp, but with high level functionalit
35 35
 gcp is at an early stage of development, and really experimental: use at your own risks !
36 36
 
37 37
 ** How to use it ? **
38
-Pretty much like cp (see gcp --help). 
38
+Pretty much like cp (see gcp --help).
39 39
 Please note that the behaviour is not exactly the same as cp, even if gcp want to be option-compatible. Mainly, the destination filenames can be changed (by default, can be deactivated).
40 40
 gcp doesn't implement yet all the options from cp, but it's planed.
41 41
 

+ 19
- 19
gcp View File

@@ -69,7 +69,7 @@ This software is an advanced file copier
69 69
 Get the latest version at http://wiki.goffi.org/wiki/Gcp
70 70
 """)
71 71
 
72
-const_DBUS_INTERFACE = "org.goffi.gcp" 
72
+const_DBUS_INTERFACE = "org.goffi.gcp"
73 73
 const_DBUS_PATH = "/org/goffi/gcp"
74 74
 const_BUFF_SIZE = 4096
75 75
 const_PRESERVE = set(['mode','ownership','timestamps'])
@@ -86,7 +86,7 @@ class DbusObject(dbus.service.Object):
86 86
         dbus.service.Object.__init__(self, bus, path)
87 87
         debug(_("Init DbusObject..."))
88 88
         self.cb={}
89
-    
89
+
90 90
     @dbus.service.method(const_DBUS_INTERFACE,
91 91
                          in_signature='', out_signature='s')
92 92
     def getVersion(self):
@@ -294,7 +294,7 @@ class GCP():
294 294
             dest_path = os.path.normpath(os.path.join(source_dir, args.pop()))
295 295
         except OSError,e:
296 296
             error (_("Invalid dest_path: %s"),e)
297
-        
297
+
298 298
         for path in args:
299 299
             abspath = os.path.normpath(os.path.join(os.path.expanduser(source_dir), path))
300 300
             if not os.path.exists(abspath):
@@ -312,7 +312,7 @@ class GCP():
312 312
 
313 313
     def __copyNextFile(self):
314 314
         """Take the last file in the list, and launch the copy using glib io_watch event
315
-           @return: True a file was added, False else""" 
315
+           @return: True a file was added, False else"""
316 316
         if self.copy_list:
317 317
             source_file, dest_path, options = self.copy_list.pop()
318 318
             self.journal.startFile(source_file)
@@ -341,7 +341,7 @@ class GCP():
341 341
                 self.journal.closeFile()
342 342
                 source_fd.close()
343 343
                 return True
344
-                
344
+
345 345
             gobject.io_add_watch(source_fd,gobject.IO_IN,self._copyFile,
346 346
                                  (dest_fd, options), priority=gobject.PRIORITY_DEFAULT)
347 347
             if not self.progress:
@@ -362,7 +362,7 @@ class GCP():
362 362
         self.journal.closeFile()
363 363
         source_fd.close()
364 364
         dest_fd.close()
365
-        
365
+
366 366
 
367 367
 
368 368
     def _copyFile(self, source_fd, condition, data):
@@ -520,7 +520,7 @@ class GCP():
520 520
 
521 521
         if options.sources_save or options.sources_replace:
522 522
             if saved_files.has_key(options.sources_save) and not options.sources_replace:
523
-                error(_("There is already a saved sources with this name, skipping --sources-save")) 
523
+                error(_("There is already a saved sources with this name, skipping --sources-save"))
524 524
             else:
525 525
                 if len(args)>1:
526 526
                     saved_files[options.sources_save] = map(os.path.abspath,args[:-1])
@@ -552,24 +552,24 @@ class GCP():
552 552
             if isinstance(full_args[idx], unicode):
553 553
                 #We don't want unicode as some filenames can be invalid unicode
554 554
                 full_args[idx] = full_args[idx].encode('utf-8')
555
-        
555
+
556 556
         parser = OptionParser(usage=_usage,version=ABOUT)
557 557
 
558 558
         parser.add_option("-r", "--recursive", action="store_true", default=False,
559 559
                     help=_("copy directories recursively"))
560
-        
560
+
561 561
         parser.add_option("-f", "--force", action="store_true", default=False,
562 562
                     help=_("force overwriting of existing files"))
563 563
 
564 564
         parser.add_option("--preserve", action="store", default='mode,ownership,timestamps',
565 565
                     help=_("preserve  the  specified  attributes"))
566
-        
566
+
567 567
         parser.add_option("-L", "--dereference", action="store_true", default=False,
568 568
                     help=_("always follow symbolic links in sources"))
569
-        
569
+
570 570
         parser.add_option("-P", "--no-dereference", action="store_false", dest='dereference',
571 571
                     help=_("never follow symbolic links in sources"))
572
-        
572
+
573 573
         #parser.add_option("--no-unicode-fix", action="store_false", dest='unicode_fix', default=True,
574 574
         #            help=_("don't fix name encoding errors")) #TODO
575 575
 
@@ -578,12 +578,12 @@ class GCP():
578 578
 
579 579
         parser.add_option("--no-progress", action="store_false", dest="progress", default=True,
580 580
                     help=_("deactivate progress bar"))
581
-        
581
+
582 582
         parser.add_option("-v", "--verbose", action="store_true", default=False,
583 583
                     help=_("Show what is currently done"))
584 584
 
585 585
         group_saving = OptionGroup(parser, "sources saving")
586
-        
586
+
587 587
         group_saving.add_option("--sources-save", action="store",
588 588
                     help=_("Save source arguments"))
589 589
 
@@ -592,19 +592,19 @@ class GCP():
592 592
 
593 593
         group_saving.add_option("--sources-load", action="store",
594 594
                     help=_("Load source arguments"))
595
-        
595
+
596 596
         group_saving.add_option("--sources-del", action="store",
597 597
                     help=_("delete saved sources"))
598
-        
598
+
599 599
         group_saving.add_option("--sources-list", action="store_true", default=False,
600 600
                     help=_("List names of saved sources"))
601
-        
601
+
602 602
         group_saving.add_option("--sources-full-list", action="store_true", default=False,
603 603
                     help=_("List names of saved sources and files in it"))
604 604
 
605 605
         parser.add_option_group(group_saving)
606 606
 
607
-        
607
+
608 608
         (options, args) = parser.parse_args(full_args)
609 609
         options.directdir = False #True only in the special case: we are copying a dir and it doesn't exists
610 610
         #options check
@@ -642,7 +642,7 @@ class GCP():
642 642
                 options.dest_file = None
643 643
         else:
644 644
             options.dest_file = None
645
-        
645
+
646 646
         #if there is an other instance of gcp, we send options to it
647 647
         if not self._main_instance:
648 648
             info (_("There is already one instance of %s running, pluging to it") % NAME_SHORT)

+ 4
- 4
test_gcp.py View File

@@ -59,8 +59,8 @@ def dirCheck(dir_path):
59 59
             if isdir(full_path):
60 60
                 recursive_sum(full_path, result)
61 61
             else:
62
-                result[full_path] = sha1sum(full_path) 
63
-    
62
+                result[full_path] = sha1sum(full_path)
63
+
64 64
     result = {}
65 65
     _ori_dir = getcwd()
66 66
     chdir(dir_path)
@@ -94,7 +94,7 @@ def makeRandomFile(path, size=S10K, buf_size=4096):
94 94
 def makeTestDir(path):
95 95
     """Helper method to easily create a test dir
96 96
     @param path: where the dir must be created"""
97
-    
97
+
98 98
     for i in range(2):
99 99
         subdir = join(path,'subdir_%d' % i)
100 100
         makedirs(subdir)
@@ -198,7 +198,7 @@ class TestCopyCases(unittest.TestCase):
198 198
         self.assertEqual(ret,0)
199 199
         check_2 = dirCheck('dest_dir')
200 200
         self.assertEqual(check_1, check_2)
201
-    
201
+
202 202
     def test_mixt_copy_existing_dest_nonrecursive(self):
203 203
         """Check that a mixt copy (files + dir) to an existing dest without the recursive option work as expected"""
204 204
         for i in range(2):

Loading…
Cancel
Save