@@ -65,13 +65,6 @@ def get_args() -> argparse.Namespace:
6565 help = "specify if server should run in development. this means requests won't get sent to a printer but logger instead" ,
6666 )
6767
68- parser .add_argument (
69- "--dev-printer" ,
70- action = "store_true" ,
71- default = False ,
72- help = "specify if we should use the virtual dev printer. requests will be processed as if it were a real printer" ,
73- )
74-
7568 parser .add_argument (
7669 "--dont-delete-pdfs" ,
7770 action = "store_true" ,
@@ -129,13 +122,13 @@ def send_file_to_printer(
129122 # only the right printer works right now, so we default to it
130123 PRINTER_NAME = os .environ .get ("RIGHT_PRINTER_NAME" )
131124
132- if (args .dev_printer ):
125+ if (args .development ):
133126 PRINTER_NAME = "HP_LaserJet_p2015dn_Right"
134127
135128 metrics_handler .print_jobs_recieved .inc ()
136129
137130 job_id = gerard .create_print_job (
138- num_copies , maybe_page_range , sides , PRINTER_NAME , file_path , args .development , args . dev_printer
131+ num_copies , maybe_page_range , sides , PRINTER_NAME , file_path , args .development
139132 )
140133 if job_id :
141134 sqlite_helpers .insert_print_job (args .database_file_path , job_id )
@@ -163,9 +156,6 @@ def metrics():
163156
164157@app .get ("/status/" )
165158async def status (id : str = '' ):
166- if not args .dev_printer and args .development :
167- return {"status" : "completed" }
168-
169159 try :
170160 db = sqlite3 .connect (args .database_file_path )
171161 cursor = db .cursor ()
@@ -223,16 +213,15 @@ async def read_item(
223213# metrics_handler referenced by the rest of the file. otherwise,
224214# the thread interacts with an instance different than the one the
225215# server uses
226- if __name__ == "server" and ( not args .development or args . dev_printer ) :
216+ if __name__ == "server" and not args .development :
227217 # set the last time we opened an ssh tunnel to now because
228218 # when the script runs for the first time, we did so in what.sh
229- if not args .dev_printer :
230- metrics_handler .ssh_tunnel_last_opened .set (int (time .time ()))
231- t = threading .Thread (
232- target = maybe_reopen_ssh_tunnel ,
233- daemon = True ,
234- )
235- t .start ()
219+ metrics_handler .ssh_tunnel_last_opened .set (int (time .time ()))
220+ t = threading .Thread (
221+ target = maybe_reopen_ssh_tunnel ,
222+ daemon = True ,
223+ )
224+ t .start ()
236225
237226 sqlite_helpers .maybe_create_table (args .database_file_path )
238227
0 commit comments