Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored python to a more sane starting point
- Loading branch information
1 parent
c08e178
commit 51f967f
Showing
39 changed files
with
203 additions
and
484 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,11 +1,62 @@ | ||
""" | ||
This setup.py script was provided by the Python package package package. | ||
import os, sys, glob | ||
from distutils.core import Command | ||
|
||
You can find the package info in ./package/info.py. | ||
try: | ||
from setuptools import setup | ||
has_setuptools = True | ||
except ImportError, err: | ||
try: | ||
from distutils.core import setup | ||
except ImportError, err: | ||
raise err | ||
|
||
See http://pypi.python.org/pypi/package/ for more information. | ||
""" | ||
class Test(Command): | ||
user_options = [] | ||
test_dir = 'tests' | ||
|
||
import package | ||
def initialize_options(self): | ||
pass | ||
|
||
package.setup() | ||
def finalize_options(self): | ||
pass | ||
|
||
def run(self): | ||
build_cmd = self.get_finalized_command('build') | ||
build_cmd.run() | ||
sys.path.insert(0, build_cmd.build_lib) | ||
sys.path.insert(0, self.test_dir) | ||
def exit(code): | ||
pass | ||
sys.exit = exit | ||
|
||
for test in glob.glob(self.test_dir + '/test*.py'): | ||
name = test[test.index('/') + 1: test.rindex('.')] | ||
module = __import__(name) | ||
if module.__dict__.get('unittest'): | ||
module.unittest.main(module=module, argv=['']) | ||
|
||
args = { | ||
'author': 'Ingy dot Net', | ||
'author_email': 'ingy@ingy.net', | ||
'cmdclass': { | ||
'test': Test, | ||
}, | ||
'description': "C'Dent - A Portable Module Programming Language", | ||
'install_requires': ['pyyaml'], | ||
'name': 'testml', | ||
# 'packages': [ | ||
# 'testml', | ||
# 'testml.compiler', | ||
# 'testml.compiler.pegex', | ||
# 'testml.compiler.lite', | ||
# 'testml.library', | ||
# 'testml.library.debug', | ||
# 'testml.library.standard', | ||
# 'testml.runtime', | ||
# 'testml.runtime.unit', | ||
# 'testml.setup', | ||
# ], | ||
'url': 'http://www.testml.org/', | ||
'version': '0.0.1', | ||
} | ||
setup(**args) |
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,5 +1,46 @@ | ||
__version__ = '0.0.1' | ||
__version__ = '0.0.2' | ||
|
||
class TestML(): | ||
def __init__(self, testml=None, bridge=None, compiler=None): | ||
pass | ||
from xxx import XXX | ||
|
||
class TestML: | ||
def __init__(self, | ||
testml=None, | ||
runtime=None, | ||
bridge=None, | ||
library=None, | ||
compiler=None, | ||
): | ||
self.testml=testml | ||
self.runtime=runtime | ||
self.bridge=bridge | ||
self.library=library | ||
self.compiler=compiler | ||
self.base='tests' | ||
|
||
def run(self, testcase): | ||
self.set_default_classes() | ||
self.runtime( | ||
compiler=self.compiler, | ||
bridge=self.bridge, | ||
library=self.library, | ||
testml=self.testml, | ||
base=self.base, | ||
).run(testcase) | ||
|
||
def set_default_classes(self): | ||
if not self.runtime: | ||
from testml.runtime.unit import Unit | ||
self.runtime = Unit | ||
if not self.compiler: | ||
from testml.compiler.pegex import Pegex | ||
self.compiler = Pegex | ||
if not self.bridge: | ||
from testml.bridge import Bridge | ||
self.bridge = Bridge | ||
if not self.library: | ||
from testml.library.standard import Standard | ||
from testml.library.debug import Debug | ||
self.library = [ | ||
Standard, | ||
Debug, | ||
] |
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,5 +1,4 @@ | ||
from testml.compiler import Compiler | ||
import testml.compiler | ||
|
||
class Lite(Compiler): | ||
class Lite(testml.compiler.Compiler): | ||
pass | ||
|
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,4 @@ | ||
import testml.compiler | ||
|
||
class Pegex(testml.compiler.Compiler): | ||
pass |
Empty file.
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,2 @@ | ||
class Debug: | ||
pass |
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,2 @@ | ||
class Standard: | ||
pass |
Oops, something went wrong.