summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2015-01-10 20:19:08 +0100
committercos <cos>2015-01-10 20:19:08 +0100
commit135d8c9ef7fe197b0547629e38f9cc73de5dbc98 (patch)
tree11dac23cc1f6d7e50b520e9145281640c1af2c29
parent7d2c6e2a32f94375be91f38481c38d68dd997610 (diff)
downloadmat-135d8c9ef7fe197b0547629e38f9cc73de5dbc98.zip
Use system wide config file for label_id_prefix & label_name.
-rwxr-xr-xmat7
1 files changed, 2 insertions, 5 deletions
diff --git a/mat b/mat
index 16478fe..48e7efd 100755
--- a/mat
+++ b/mat
@@ -14,9 +14,6 @@ use Text::Iconv;
tie my %Config, "Config::Simple", '/etc/mat.conf';
-use constant LABEL_NAME => $Config{'label_name'};
-use constant LABEL_ID_PREFIX => $Config{'label_id_prefix'};
-
#use Data::Dumper;
my $db = DBI->connect("dbi:SQLite:recipe.db", "", "", {RaiseError => 1,
@@ -276,11 +273,11 @@ sub print_label {
my $y_border = 40;
my $iconv = Text::Iconv->new("UTF-8", "ISO8859-1");
- my $row0 = LABEL_NAME;
+ my $row0 = $Config{'label_name'};
my $row1 = $iconv->convert($dish_name);
my $row2 = `date +%Y%m%d|tr -d '\n'`.' ('.$amount.'g)';
- my $idbarcode = GD::Barcode::QRcode->new(sprintf("%s%d", LABEL_ID_PREFIX, $id), { Version=>3 });
+ my $idbarcode = GD::Barcode::QRcode->new(sprintf("%s%d", $Config{'label_id_prefix'}, $id), { Version=>3 });
my $idbarcode_image=$idbarcode->plot();
my $idtext = new GD::Image(500, $fontsize * 2);