diff options
author | cos <cos> | 2014-11-21 21:43:48 +0100 |
---|---|---|
committer | cos <cos> | 2014-11-21 21:47:40 +0100 |
commit | 957c73087d6b090de5dc8953adc7086cac6641ec (patch) | |
tree | e899e13d77eee5b1d4d3f3fd01a806f7454bd3b5 | |
parent | 9a9ccd11e0fe68232cc605f9bfdd883f4c0afe4f (diff) | |
download | mat-957c73087d6b090de5dc8953adc7086cac6641ec.zip |
Use a config file instead of hard coding everything.
-rwxr-xr-x | mat | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3,6 +3,7 @@ use warnings; use strict; +use Config::Simple; use DBI; use DateTime; use DateTime::Format::ISO8601; @@ -11,6 +12,8 @@ use GD::Barcode; use GD::Barcode::QRcode; use Text::Iconv; +tie my %Config, "Config::Simple", '/etc/mat.conf'; + use constant LABEL_NAME => `sed --silent 's/^label_name //p' < config|tr -d '\\n'`; use constant LABEL_ID_PREFIX => `sed --silent 's/^label_id_prefix //p' < config|tr -d '\\n'`; @@ -340,7 +343,7 @@ sub print_label { open(PNGFILE, ">label.png"); print PNGFILE $label->png; - system("convert -density 300 label.png label.ps && lp -d QL-720NW label.ps"); + system($Config{'print_command'}); } sub cmd_storeportion { |