-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated requirements and added some test cases
- Loading branch information
Showing
25 changed files
with
242 additions
and
893 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
# pyCEURmake | ||
CEUR make python implementation | ||
|
||
CEUR make python implementation for https://ceur-ws.org/ | ||
|
||
[![Join the discussion at https://github.com/WolfgangFahl/pyCEURMake/discussions](https://img.shields.io/github/discussions/WolfgangFahl/pyCEURMake)](https://github.com/WolfgangFahl/pyCEURMake/discussions) | ||
[![pypi](https://img.shields.io/pypi/pyversions/pyCEURMake)](https://pypi.org/project/pyCEURMake/) | ||
[![Github Actions Build](https://github.com/WolfgangFahl/pyCEURmake/workflows/Build/badge.svg?branch=main)](https://github.com/WolfgangFahl/pyCEURmake/actions?query=workflow%3ABuild+branch%3Amain) | ||
[![PyPI Status](https://img.shields.io/pypi/v/pyCEURMake.svg)](https://pypi.python.org/pypi/pyCEURMake/) | ||
[![GitHub issues](https://img.shields.io/github/issues/WolfgangFahl/pyCEURmake.svg)](https://github.com/WolfgangFahl/pyCEURmake/issues) | ||
[![GitHub closed issues](https://img.shields.io/github/issues-closed/WolfgangFahl/pyCEURmake.svg)](https://github.com/WolfgangFahl/pyCEURmake/issues/?q=is%3Aissue+is%3Aclosed) | ||
[![License](https://img.shields.io/github/license/WolfgangFahl/pyCEURMake.svg)](https://www.apache.org/licenses/LICENSE-2.0) | ||
|
||
## Docs and Tutorials | ||
[Wiki](https://wiki.bitplan.com/index.php/PyCEURmake) | ||
|
||
## CEUR-WS Volume Browser | ||
[Volume Browser http://ceur-ws-browser.bitplan.com](http://ceur-ws-browser.bitplan.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.1.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
''' | ||
Created on 2023-02-20 | ||
@author: wf | ||
''' | ||
from ceurws.ceur_ws import VolumeManager | ||
from ceurws.version import Version | ||
import sys | ||
from argparse import ArgumentParser | ||
from argparse import RawDescriptionHelpFormatter | ||
import traceback | ||
import webbrowser | ||
# import after app! | ||
from jpcore.justpy_app import JustpyServer | ||
|
||
def getArgParser(description:str,version_msg)->ArgumentParser: | ||
""" | ||
Setup command line argument parser | ||
Args: | ||
description(str): the description | ||
version_msg(str): the version message | ||
Returns: | ||
ArgumentParser: the argument parser | ||
""" | ||
parser = ArgumentParser(description=description, formatter_class=RawDescriptionHelpFormatter) | ||
parser.add_argument("-a","--about",help="show about info [default: %(default)s]",action="store_true") | ||
parser.add_argument("-d", "--debug", dest="debug", action="store_true", help="show debug info [default: %(default)s]") | ||
parser.add_argument("--host",default=JustpyServer.getDefaultHost(),help="the host to serve / listen from [default: %(default)s]") | ||
parser.add_argument("-l", "--list", action="store_true", help="list all volumes [default: %(default)s]") | ||
parser.add_argument("--port",type=int,default=9998,help="the port to serve from [default: %(default)s]") | ||
parser.add_argument("-s","--serve", action="store_true", help="start webserver [default: %(default)s]") | ||
parser.add_argument("-V", "--version", action='version', version=version_msg) | ||
return parser | ||
|
||
def main(argv=None): # IGNORE:C0111 | ||
'''main program.''' | ||
|
||
if argv is None: | ||
argv=sys.argv[1:] | ||
|
||
program_name = "ceur-ws" | ||
program_version =f"v{Version.version}" | ||
program_build_date = str(Version.date) | ||
program_version_message = f'{program_name} ({program_version},{program_build_date})' | ||
|
||
try: | ||
parser=getArgParser(description=Version.license,version_msg=program_version_message) | ||
args = parser.parse_args(argv) | ||
if len(argv) < 1: | ||
parser.print_usage() | ||
sys.exit(1) | ||
if args.about: | ||
print(program_version_message) | ||
print(f"see {Version.doc_url}") | ||
webbrowser.open(Version.doc_url) | ||
elif args.serve: | ||
from ceurws.volumebrowser import VolumeBrowser | ||
volumeBrowser=VolumeBrowser(version=Version,args=args) | ||
url=f"http://{args.host}:{args.port}" | ||
webbrowser.open(url) | ||
volumeBrowser.start(host=args.host, port=args.port,debug=args.debug) | ||
pass | ||
elif args.list: | ||
manager=VolumeManager() | ||
manager.loadFromBackup() | ||
for volume in manager.getList(): | ||
print(volume) | ||
except KeyboardInterrupt: | ||
### handle keyboard interrupt ### | ||
return 1 | ||
except Exception as e: | ||
if DEBUG: | ||
raise(e) | ||
indent = len(program_name) * " " | ||
sys.stderr.write(program_name + ": " + repr(e) + "\n") | ||
sys.stderr.write(indent + " for help use --help") | ||
if args.debug: | ||
print(traceback.format_exc()) | ||
return 2 | ||
|
||
DEBUG = 1 | ||
if __name__ == "__main__": | ||
if DEBUG: | ||
sys.argv.append("-d") | ||
sys.exit(main()) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.