mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 10:12:35 -04:00 
			
		
		
		
	Uses the correct styling for output messages
This commit is contained in:
		
							parent
							
								
									a823b8f70c
								
							
						
					
					
						commit
						dd4d903f69
					
				| @ -37,7 +37,7 @@ repos: | |||||||
|         exclude: "(^Pipfile\\.lock$)" |         exclude: "(^Pipfile\\.lock$)" | ||||||
|   # Python hooks |   # Python hooks | ||||||
|   - repo: https://github.com/asottile/reorder_python_imports |   - repo: https://github.com/asottile/reorder_python_imports | ||||||
|     rev: v3.0.1 |     rev: v3.1.0 | ||||||
|     hooks: |     hooks: | ||||||
|       - id: reorder-python-imports |       - id: reorder-python-imports | ||||||
|         exclude: "(migrations)" |         exclude: "(migrations)" | ||||||
|  | |||||||
| @ -152,4 +152,4 @@ class Command(BaseCommand): | |||||||
|                     ), |                     ), | ||||||
|                 ) |                 ) | ||||||
|         except KeyboardInterrupt: |         except KeyboardInterrupt: | ||||||
|             print("Aborting...") |             self.stdout.write(self.style.NOTICE(("Aborting..."))) | ||||||
|  | |||||||
| @ -80,6 +80,18 @@ class Command(BaseCommand): | |||||||
|         if os.path.exists(version_path): |         if os.path.exists(version_path): | ||||||
|             with open(version_path) as f: |             with open(version_path) as f: | ||||||
|                 self.version = json.load(f)["version"] |                 self.version = json.load(f)["version"] | ||||||
|  |                 # Provide an initial warning if needed to the user | ||||||
|  |                 if self.version != version.__full_version_str__: | ||||||
|  |                     self.stdout.write( | ||||||
|  |                         self.style.WARNING( | ||||||
|  |                             "Version mismatch:" | ||||||
|  |                             f" {self.version} vs {version.__full_version_str__}." | ||||||
|  |                             "  Continuing, but import may fail", | ||||||
|  |                         ), | ||||||
|  |                     ) | ||||||
|  | 
 | ||||||
|  |         else: | ||||||
|  |             self.stdout.write(self.style.WARNING("No version.json file located")) | ||||||
| 
 | 
 | ||||||
|         self._check_manifest() |         self._check_manifest() | ||||||
|         with disable_signal( |         with disable_signal( | ||||||
| @ -110,8 +122,12 @@ class Command(BaseCommand): | |||||||
| 
 | 
 | ||||||
|                 self._import_files_from_manifest(options["no_progress_bar"]) |                 self._import_files_from_manifest(options["no_progress_bar"]) | ||||||
| 
 | 
 | ||||||
|         print("Updating search index...") |         self.stdout.write("Updating search index...") | ||||||
|         call_command("document_index", "reindex") |         call_command( | ||||||
|  |             "document_index", | ||||||
|  |             "reindex", | ||||||
|  |             no_progress_bar=options["no_progress_bar"], | ||||||
|  |         ) | ||||||
| 
 | 
 | ||||||
|     @staticmethod |     @staticmethod | ||||||
|     def _check_manifest_exists(path): |     def _check_manifest_exists(path): | ||||||
| @ -154,7 +170,7 @@ class Command(BaseCommand): | |||||||
|         os.makedirs(settings.THUMBNAIL_DIR, exist_ok=True) |         os.makedirs(settings.THUMBNAIL_DIR, exist_ok=True) | ||||||
|         os.makedirs(settings.ARCHIVE_DIR, exist_ok=True) |         os.makedirs(settings.ARCHIVE_DIR, exist_ok=True) | ||||||
| 
 | 
 | ||||||
|         print("Copy files into paperless...") |         self.stdout.write("Copy files into paperless...") | ||||||
| 
 | 
 | ||||||
|         manifest_documents = list( |         manifest_documents = list( | ||||||
|             filter(lambda r: r["model"] == "documents.document", self.manifest), |             filter(lambda r: r["model"] == "documents.document", self.manifest), | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user