Initial commit

This commit is contained in:
Robert Miles 2018-12-01 04:42:45 +00:00
commit 17bfb9a18c
6 changed files with 181 additions and 0 deletions

119
.gitignore vendored Normal file
View File

@ -0,0 +1,119 @@
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
### Python Patch ###
.venv/

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# cosmic-newlog
A setup for managing the automated creation of new logs for cosmic.voyage ships.

0
newlog/__init__.py Normal file
View File

14
newlog/config.py Normal file
View File

@ -0,0 +1,14 @@
from configparser import ConfigParser
from os.path import expanduser as resolvePath
class Config:
def __init__(self,path="~/.config/newlog/config.ini"):
with open(resolvePath(path)) as f:
self.config = ConfigParser(f)
self.ship = False
def setShip(self,ship):
self.ship=ship
def getProperty(self,name):
if not self.ship:
return False
return self.config.get(self.ship,property)

13
newlog/console.py Normal file
View File

@ -0,0 +1,13 @@
import argparse,sys,subprocess
from os.path import expanduser,join
resolvePath = expanduser
pathJoin = join
def mkdir(path,flags=["-p"]):
return subprocess.run(["/bin/mkdir"]+flags+[resolvePath(path)])
def main(argv=sys.argv):
parser = argparse.ArgumentParser(prog="newlog",description="Allows you to pre-format new logs for cosmic.voyage.")
parser.add_argument("-n","--number-file",default="~/.newlog/number",help="Change the file used to keep track of the number log.")
args=parser.parse_args(argv)
print(args)

32
setup.py Normal file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md')) as f:
README = f.read()
REQUIREMENTS = []
setup(
name='cosmic.voyage-newlog',
version='0.1.0',
description='cosmic.voyage-newlog',
long_description=README,
author='Robert Miles',
author_email='khuxkm@tilde.team',
url='https://tildegit.org/khuxkm/cosmic-newlog',
license="MIT",
install_requires=REQUIREMENTS,
keywords=[],
packages=find_packages(),
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3.3',
],
entry_points={
'console_scripts': ['newlog = newlog.console:main']
},
)