From 71ab0bebd5b6e675d70ff1d17bfa36c4e6a1fc7b Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Thu, 12 Feb 2026 09:34:16 +0100 Subject: [PATCH] frappy-edit: add missing bin/frappy-edit Change-Id: I43b4d645186342c08d296ef5482e63f1ec667b93 --- bin/frappy-edit | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 bin/frappy-edit diff --git a/bin/frappy-edit b/bin/frappy-edit new file mode 100755 index 00000000..7b96721c --- /dev/null +++ b/bin/frappy-edit @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +# ***************************************************************************** +# Copyright (c) 2015-2024 by the authors, see LICENSE +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Module authors: +# Markus Zolliker +# +# ***************************************************************************** + +import sys +import os +from pathlib import Path + +# Add import path for inplace usage +repo = Path(__file__).absolute().parents[1] +sys.path.insert(0, str(repo)) + +from frappy.lib import generalConfig +from frappy.tools.cfgedit import EditorMain + +# merge cfg dirs from env variable and the ones typically used at psi +# use dicts instead of sets, as we want to keep order +cfgdirs = os.environ.get('FRAPPY_CONFDIR', None) +cfgdirs = cfgdirs.split(':') if cfgdirs else [] +for cfgdir in 'cfg', 'cfg/main', 'cfg/stick', 'cfg/addons': + cfgpath = repo / cfgdir + if cfgpath.exists(): + cfgdirs.append(str(cfgpath)) +os.environ['FRAPPY_CONFDIR'] = ':'.join(cfgdirs) +generalConfig.init() +EditorMain(sys.argv[1]).run()