Compare commits
	
		
			4 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 534d7ad615 | |||
| ce03d7b5b0 | |||
| 049c87869a | |||
| f02ca04c4c | 
| @@ -26,3 +26,12 @@ Usage | ||||
| ----- | ||||
|  | ||||
| ```python -m partdb-labeler -h``` will show you the available options. | ||||
|  | ||||
| For convenience, you might also consider adding a short shell script somewhere in your PATH that will call the Python module | ||||
| with your server configuration.  I use this (the API key is a read-only key I've publicized elsewhere): | ||||
|  | ||||
| ``` | ||||
| #!/usr/bin/env bash | ||||
| python -m partdb-labeler -p https://partdb.alfter.us -k tcp_673fc81f0b7837ca4c029fbd6536b27742eb8b742eba27bf547c8136dc6a84f8 $* | ||||
| ``` | ||||
|  | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								dist/partdb_labeler-0.1.0-py2.py3-none-any.whl
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								dist/partdb_labeler-0.1.0-py2.py3-none-any.whl
									
									
									
									
										vendored
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								dist/partdb_labeler-0.1.0.tar.gz
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								dist/partdb_labeler-0.1.0.tar.gz
									
									
									
									
										vendored
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								dist/partdb_labeler-0.1.2-py2.py3-none-any.whl
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								dist/partdb_labeler-0.1.2-py2.py3-none-any.whl
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								dist/partdb_labeler-0.1.2.tar.gz
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								dist/partdb_labeler-0.1.2.tar.gz
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -13,9 +13,10 @@ parser.add_argument("-x", help="label width, in inches (default: 2\")", type=flo | ||||
| parser.add_argument("-y", help="label height, in inches (default: 1\")", type=float) | ||||
| parser.add_argument("-g", help="label gap, in inches (default: 0.118\")", type=float) | ||||
| parser.add_argument("-q", help="send to selected print queue instead of stdout") | ||||
| parser.add_argument("-p", help="PartDB base URL (default: https://partdb.alfter.us)") | ||||
| parser.add_argument("-k", help="PartDB API key (default: anonymous key for partdb.alfter.us)") | ||||
| parser.add_argument("-r", help="printer resolution (203 or 300; default: 203 dpi)", type=int) | ||||
| parser.add_argument("-p", help="PartDB base URL") | ||||
| parser.add_argument("-k", help="PartDB API key") | ||||
| parser.add_argument("-r", help="printer resolution (default: 203 dpi)", type=int) | ||||
| parser.add_argument('-v', action='version', version='%(prog)s 0.1.2') | ||||
| args=parser.parse_args() | ||||
| id=args.id | ||||
| if args.x==None: | ||||
| @@ -34,14 +35,8 @@ if args.q==None: | ||||
|     queue="zebra_python_unittest" | ||||
| else: | ||||
|     queue=args.q | ||||
| if args.p==None: | ||||
|     base_url="https://partdb.alfter.us" | ||||
| else: | ||||
|     base_url=args.p | ||||
| if args.k==None: | ||||
|     api_key="tcp_673fc81f0b7837ca4c029fbd6536b27742eb8b742eba27bf547c8136dc6a84f8" | ||||
| else: | ||||
|     api_key=args.k | ||||
| base_url=args.p | ||||
| api_key=args.k | ||||
| if args.r==None: | ||||
|     res=203 | ||||
| else: | ||||
| @@ -52,11 +47,18 @@ else: | ||||
| # width and height for built-in monospace fonts (includes whitespace) | ||||
|  | ||||
| font_metrics={} | ||||
| font_metrics[1]=(10,14) | ||||
| font_metrics[2]=(12,18) | ||||
| font_metrics[3]=(14,22) | ||||
| font_metrics[4]=(16,26) | ||||
| font_metrics[5]=(34,50) | ||||
| if res==203: | ||||
|     font_metrics[1]=(10,14) | ||||
|     font_metrics[2]=(12,18) | ||||
|     font_metrics[3]=(14,22) | ||||
|     font_metrics[4]=(16,26) | ||||
|     font_metrics[5]=(34,50) | ||||
| if res==300: | ||||
|     font_metrics[1]=(14,22) | ||||
|     font_metrics[2]=(18,30) | ||||
|     font_metrics[3]=(22,38) | ||||
|     font_metrics[4]=(26,46) | ||||
|     font_metrics[5]=(50,82) | ||||
|  | ||||
| # make substitutions for characters not in CP437 | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ authors = [ | ||||
| 	{name="Scott Alfter", email="scott@alfter.us"} | ||||
| ] | ||||
| description = "PartDB Labeler" | ||||
| version = "0.1.0" | ||||
| version = "0.1.2" | ||||
| readme = "README.md" | ||||
| dependencies = ["requests", "zebra", "qrcode", "pillow"] | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user