Commits

Anton Shestakov committed 7ee7077

Fixed startup without arguments. Actually support directory structure declared in .torrent. Wider pseudo-table in output.

Comments (0)

Files changed (1)

         
     dry_run = False
     quiet = False
+    source_file = None
+    dirty_directory = None
 
     for o, a in opts:
         if o in ('-s', '--source', '-t', '--torrent'):
     src_sizes = bulk['info']['files']
     
     for src_file in src_sizes:
-        if len(src_file['path']) > 1:
-            # debug me
-            print('DEBUG: %s' % src_file)
-            break
-        real_path = os.path.join(dirty_directory, src_file['path'][0])
+        filename = os.path.join(*src_file['path'])
+        real_path = os.path.join(dirty_directory, filename)
         try:
             real_size = os.stat(real_path).st_size
         except OSError:
         if real_size > src_file['length']:
             if not quiet:
                 if not header_printed:
-                    print('%s %25s %19s %20s' % (
+                    print('%s %27s %19s %20s' % (
                         'OPERATION', 'FILE', 'SIZE DECLARED', 'SIZE FOUND'))
                     header_printed = True
-                print('unlink %28s: %12d bytes > %12d bytes' % (
-                    src_file['path'][0], real_size, src_file['length']))
+                print('unlink %30s: %12d bytes > %12d bytes' % (
+                    filename, real_size, src_file['length']))
 
             if not dry_run:
                 try: