Skip to content

Commit

Permalink
Rename from argsupport to simpleapp
Browse files Browse the repository at this point in the history
  • Loading branch information
mhosken committed Nov 28, 2024
1 parent d0ecaa5 commit 9c71908
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 33 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# argsupport
# simpleapp

argsupport is a python module designed to make it easy to create simple
simpleapp is a python module designed to make it easy to create simple
applications for sharing with colleagues who may not have python installed, etc.
The initial application area targetted is text processing and conversion. The
aim is to enable a relatively weak python programmer (who may only use python
Expand All @@ -10,15 +10,15 @@ into a full blow application.

The module uses the gooey module to provide a GUI for the command line options.

The two main areas where argsupport helps is in providing a more sophisticated
The two main areas where simpleapp helps is in providing a more sophisticated
drop in replacement for argparse (sitting between argparse and gooey) and a
pipeline function that can process data in a pipeline.

Here is a motivating example:

```
import argsupport, codecs
from argsupport.pipeline import Pipeline, textinfile, textoutfile
import simpleapp, codecs
from simpleapp.pipeline import Pipeline, textinfile, textoutfile
def process(txt, args):
if args.reverse:
Expand All @@ -28,7 +28,7 @@ def process(txt, args):
return res
def main(argv=None):
parser = argsupport.ArgumentParser(prog="uniraw")
parser = simpleapp.ArgumentParser(prog="uniraw")
parser.add_argument("infiles",nargs="+",help="Input file")
parser.add_argument("-o","--outfile",help="Output file")
parser.add_argument("-r","--reverse",action="store_true",help="Expand out Unicode chars")
Expand Down
13 changes: 5 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=62.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "argsupport"
name = "simpleapp"
version = "0.1"
# (also manually bump version in src/feaxlib/__init__.py)
authors = [{name = "Martin Hosken", email = "[email protected]"}]
Expand All @@ -30,7 +30,7 @@ git = [
]

[project.urls]
Home-Page = "https://github.com/silnrsi/python-argsupport"
Home-Page = "https://github.com/silnrsi/python-simpleapp"

[tool.setuptools.packages.find]
where = ["src"]
Expand All @@ -44,13 +44,10 @@ where = ["src"]
[tool.bdist_wheel]
universal = true

[tool.setuptools.package-data]
argsupport = ["gooey/languages/*.json", "gooey/images/*.png", "gooey/images/program_icon.*"]

[project.scripts]
createargsupport = "argsupport.project:main"
runregchanges = "argsupport.examples.runregchanges:main"
createsimpleapp = "simpleapp.project:main"
runregchanges = "simpleapp.examples.runregchanges:main"

[project.entry-points.pyinstaller40]
hook-dirs = "argsupport.__pyinstaller:get_hook_dirs"
hook-dirs = "simpleapp.__pyinstaller:get_hook_dirs"

3 changes: 0 additions & 3 deletions src/argsupport/__init__.py

This file was deleted.

3 changes: 3 additions & 0 deletions src/simpleapp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

from simpleapp.argparse import ArgumentParser
from simpleapp.pipeline import Pipeline
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import argsupport
from argsupport.pipeline import Pipeline, textinfile, textoutfile
import simpleapp
from simpleapp.pipeline import Pipeline, textinfile, textoutfile

def process(txt, args):
return txt

def main(argv=None):
parser = argsupport.ArgumentParser(prog="nothing")
parser = simpleapp.ArgumentParser(prog="nothing")
parser.add_argument("infiles",nargs="+",help="Input file")
parser.add_argument("-o","--outfile",help="Output file")
parser.add_argument('-l','--logging',help="Logging level [DEBUG, INFO, WARN, ERROR, number]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import os, regex, sys
import logging
import argsupport
import simpleapp

try:
from argsupport.pipeline import Pipeline, textinfile, textoutfile
from simpleapp.pipeline import Pipeline, textinfile, textoutfile
except ImportError:
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "src"))
from argsupport.pipeline import Pipeline, textinfile, textoutfile
from simpleapp.pipeline import Pipeline, textinfile, textoutfile

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -101,7 +101,7 @@ def readChanges(fname):
return changes

def main(argv=None):
parser = argsupport.ArgumentParser(prog='runregchanges')
parser = simpleapp.ArgumentParser(prog='runregchanges')
parser.add_argument("infiles",nargs="+",help="Input file")
parser.add_argument("-c","--changes",required=True,help="changes.txt")
parser.add_argument("-o","--outfile",help="Output file")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

import argsupport, codecs
from argsupport.pipeline import Pipeline, textinfile, textoutfile
import simpleapp, codecs
from simpleapp.pipeline import Pipeline, textinfile, textoutfile

def process(txt, args):
if args.reverse:
Expand All @@ -11,7 +11,7 @@ def process(txt, args):
return res

def main(argv=None):
parser = argsupport.ArgumentParser(prog="uniraw")
parser = simpleapp.ArgumentParser(prog="uniraw")
parser.add_argument("infiles",nargs="+",help="Input file")
parser.add_argument("-o","--outfile",help="Output file")
parser.add_argument("-r","--reverse",action="store_true",help="Expand out Unicode chars")
Expand Down
File renamed without changes.
10 changes: 4 additions & 6 deletions src/argsupport/project.py → src/simpleapp/project.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from argsupport.toml import totoml
from simpleapp.toml import totoml

def create_pyproject(name, modulepath, **kw):
res = {}
Expand All @@ -26,18 +26,16 @@ def create_pyproject(name, modulepath, **kw):

def create_module(name, modulepath, **kw):
template = f"""
import argsupport
from argsupport.pipeline import Pipeline, textinfile, textoutfile
import simpleapp
from simpleapp.pipeline import Pipeline, textinfile, textoutfile
def process(txt, args):
return txt
def main(argv=None):
parser = argsupport.ArgumentParser(prog="{name}")
parser = simpleapp.ArgumentParser(prog="{name}")
parser.add_argument("infiles",nargs="+",help="Input file")
parser.add_argument("-o","--outfile",help="Output file")
parser.add_argument('-l','--logging',help="Logging level [DEBUG, INFO, WARN, ERROR, number]")
parser.add_argument('--logfile',default='{name}.log',help='Set logging file')
args = parser.parse_args(argv)
Pipeline(args.infiles, args.outfile, args, textinfile, process, textoutfile,
Expand Down
File renamed without changes.

0 comments on commit 9c71908

Please sign in to comment.