mirror of
https://github.com/ParticulateFlow/lammps-doc-utils.git
synced 2025-12-08 06:47:45 +00:00
Some restructuring to follow common Python practices
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
__pycache__
|
||||
*.egg-info
|
||||
@ -1 +0,0 @@
|
||||
../src/txt2html.py
|
||||
@ -1 +0,0 @@
|
||||
../src/txt2rst.py
|
||||
0
lammpsdoc/__init__.py
Normal file
0
lammpsdoc/__init__.py
Normal file
@ -689,6 +689,9 @@ class Txt2HtmlConverter(TxtConverter):
|
||||
filename, ext = os.path.splitext(path)
|
||||
return filename + ".html"
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
app = Txt2HtmlConverter()
|
||||
app.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@ -21,8 +21,8 @@
|
||||
import os
|
||||
import re
|
||||
import argparse
|
||||
import lammps_filters
|
||||
from txt2html import Markup, Formatting, TxtParser, TxtConverter
|
||||
from lammpsdoc import lammps_filters
|
||||
from lammpsdoc.txt2html import Markup, Formatting, TxtParser, TxtConverter
|
||||
|
||||
class RSTMarkup(Markup):
|
||||
def __init__(self):
|
||||
@ -336,6 +336,9 @@ class Txt2RstConverter(TxtConverter):
|
||||
filename, ext = os.path.splitext(path)
|
||||
return filename + ".rst"
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
app = Txt2RstConverter()
|
||||
app.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
17
setup.py
Normal file
17
setup.py
Normal file
@ -0,0 +1,17 @@
|
||||
from setuptools import setup
|
||||
|
||||
setup(name='LAMMPS Documentation Utilities',
|
||||
version='2.0.0',
|
||||
description='Utilities to convert existing LAMMPS documentation text files into ReStructured Text',
|
||||
url='https://github.com/rbberger/lammps-doc-utils',
|
||||
author='Richard Berger',
|
||||
author_email='richard.berger@outlook.com',
|
||||
license='GPL',
|
||||
packages=['lammpsdoc'],
|
||||
test_suite='nose.collector',
|
||||
tests_require=['nose'],
|
||||
entry_points = {
|
||||
"console_scripts": ['txt2html = lammpsdoc.txt2html:main',
|
||||
'txt2rst = lammpsdoc.txt2rst:main']
|
||||
},
|
||||
)
|
||||
@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import unittest
|
||||
import txt2rst
|
||||
from lammpsdoc import txt2rst
|
||||
|
||||
class TestStructuralFilters(unittest.TestCase):
|
||||
def setUp(self):
|
||||
@ -19,7 +19,7 @@ import unittest
|
||||
import tempfile
|
||||
import io
|
||||
import os
|
||||
import txt2html
|
||||
from lammpsdoc import txt2html
|
||||
|
||||
class TestBasicFormatting(unittest.TestCase):
|
||||
def setUp(self):
|
||||
@ -18,7 +18,7 @@
|
||||
import io
|
||||
import tempfile
|
||||
import unittest
|
||||
import txt2rst
|
||||
from lammpsdoc import txt2rst
|
||||
|
||||
class TestBasicFormatting(unittest.TestCase):
|
||||
def setUp(self):
|
||||
Reference in New Issue
Block a user