mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +00:00 
			
		
		
		
	python: Normalize quotes with Black.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							11741543da
						
					
				
				
					commit
					6e4c3e41dc
				
			| @@ -9,7 +9,7 @@ from zerver.lib.queue import queue_json_publish | ||||
|  | ||||
|  | ||||
| def error(*args: Any) -> None: | ||||
|     raise Exception('We cannot enqueue because settings.USING_RABBITMQ is False.') | ||||
|     raise Exception("We cannot enqueue because settings.USING_RABBITMQ is False.") | ||||
|  | ||||
|  | ||||
| class Command(BaseCommand): | ||||
| @@ -25,17 +25,17 @@ You can use "-" to represent stdin. | ||||
|  | ||||
|     def add_arguments(self, parser: ArgumentParser) -> None: | ||||
|         parser.add_argument( | ||||
|             'queue_name', metavar='<queue>', help="name of worker queue to enqueue to" | ||||
|             "queue_name", metavar="<queue>", help="name of worker queue to enqueue to" | ||||
|         ) | ||||
|         parser.add_argument( | ||||
|             'file_name', metavar='<file>', help="name of file containing JSON lines" | ||||
|             "file_name", metavar="<file>", help="name of file containing JSON lines" | ||||
|         ) | ||||
|  | ||||
|     def handle(self, *args: Any, **options: str) -> None: | ||||
|         queue_name = options['queue_name'] | ||||
|         file_name = options['file_name'] | ||||
|         queue_name = options["queue_name"] | ||||
|         file_name = options["file_name"] | ||||
|  | ||||
|         if file_name == '-': | ||||
|         if file_name == "-": | ||||
|             f: IO[str] = sys.stdin | ||||
|         else: | ||||
|             f = open(file_name) | ||||
| @@ -47,11 +47,11 @@ You can use "-" to represent stdin. | ||||
|  | ||||
|             line = line.strip() | ||||
|             try: | ||||
|                 payload = line.split('\t')[1] | ||||
|                 payload = line.split("\t")[1] | ||||
|             except IndexError: | ||||
|                 payload = line | ||||
|  | ||||
|             print(f'Queueing to queue {queue_name}: {payload}') | ||||
|             print(f"Queueing to queue {queue_name}: {payload}") | ||||
|  | ||||
|             # Verify that payload is valid json. | ||||
|             data = orjson.loads(payload) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user