feat: Update storage file handling and version to 0.3.0

This commit is contained in:
Don Harper 2026-04-26 23:14:18 -05:00
parent 51a1697c83
commit 26acd66467
4 changed files with 15 additions and 4 deletions

View file

@ -24,7 +24,12 @@ class Pen:
class PenTracker:
def __init__(self, storage_file: str = None):
if storage_file is None:
storage_file = os.getenv('PEN_TRACKER_CSV', 'Pens.csv')
storage_file = os.getenv('PEN_TRACKER_CSV')
if storage_file is None:
data_home = os.getenv('XDG_DATA_HOME', os.path.expanduser('~/.local/share'))
app_data_dir = os.path.join(data_home, 'pen-tracker')
os.makedirs(app_data_dir, exist_ok=True)
storage_file = os.path.join(app_data_dir, 'pens.csv')
self.storage_file = storage_file
self.headers = [
'Make', 'Model', 'Date-Purchased', 'Vendor', 'Nib',