5 Commits b709eb70c4 ... 5ee550a53d

Author SHA1 Message Date
  Daniel Sheffield 5ee550a53d add mapping directives 1 week ago
  Daniel Sheffield cd27b5b7de map misc to MISC 1 week ago
  Daniel Sheffield 9f314a5974 add farmers market 1 week ago
  Daniel Sheffield 220ea19fa9 update credentials 1 week ago
  Daniel Sheffield e76a10e29f update credentials 1 week ago
3 changed files with 7 additions and 4 deletions
  1. 3 3
      grocery_transactions.py
  2. 1 1
      grocery_transactions.sh
  3. 3 0
      reconcile.py

+ 3 - 3
grocery_transactions.py

@@ -14,9 +14,10 @@ from app.data.QueryManager import QueryManager, display_mapper
 from app.palette import iter_palettes, solarized
 
 try:
-    from db_credentials import HOST, PASSWORD
+    from db_credentials import USER, HOST, PASSWORD
     host = f'host={HOST}'
     password = f'password={PASSWORD}'
+    user = f'user={USER}'
 except:
     host = ''
     password = ''
@@ -25,8 +26,7 @@ try:
     import os
 
     import psycopg
-    user = os.getenv('USER')
-    conn: Cursor = psycopg.connect(f"{host} dbname=grocery user={user} {password}")
+    conn: Cursor = psycopg.connect(f"{host} dbname=grocery {user} {password}")
     cur = conn.cursor()
 except:
     print('Failed to set up db connection. Entering Mock mode')

+ 1 - 1
grocery_transactions.sh

@@ -66,7 +66,7 @@ else
     PASSWORD=
 fi
 
-psql ${HOST} -d grocery <<EOF
+psql ${HOST} -d grocery -U ${USER} <<EOF
 BEGIN;
 $(cat - )
 SELECT

+ 3 - 0
reconcile.py

@@ -56,6 +56,7 @@ STORE_CODES = {
     'Dreamview Cre': 'DV',
     'new world': 'NW',
     'BIN INN': 'BI',
+    'MAPBI': 'BI',
     'NEW SAVE': 'NS',
     'ORGANIC NATION' : 'ON',
     'The Warehouse' : 'WH',
@@ -70,6 +71,8 @@ STORE_CODES = {
     'FC12-3189-0013895-00': 'DV',
     'ORGANIC FOOD SH' : 'TOFS',
     'WWNZ' : 'CD',
+    'Farmers Market': 'FM',
+    'MAPMISC': 'MISC',
 }
 
 conn = psycopg.connect(f"{host} dbname=grocery {user} {password}")