mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-10 23:20:57 +00:00
QT: change dir layout, packaging begins
This commit is contained in:
parent
6aade0ffc8
commit
b6105ca5b6
29
src/pytomb/tomblib/test_parser.py
Normal file
29
src/pytomb/tomblib/test_parser.py
Normal file
@ -0,0 +1,29 @@
|
||||
from tomblib.parser import *
|
||||
|
||||
class TestWrong:
|
||||
def test_wrong_tag(self):
|
||||
assert parse_line(' [a] foo') is None
|
||||
def test_no_space(self):
|
||||
assert parse_line(' [!]foo') is None
|
||||
|
||||
class TestError:
|
||||
def test_simple(self):
|
||||
parse = parse_line('[!] foo')
|
||||
assert parse is not None
|
||||
assert parse['type'] == 'error'
|
||||
assert parse['content'] == 'foo'
|
||||
def test_preceding(self):
|
||||
parse = parse_line(' [!] foo')
|
||||
assert parse is not None
|
||||
assert parse['type'] == 'error'
|
||||
assert parse['content'] == 'foo'
|
||||
def test_following(self):
|
||||
parse = parse_line('[!]shdad foo')
|
||||
assert parse is not None
|
||||
assert parse['type'] == 'error'
|
||||
assert parse['content'] == 'foo'
|
||||
def test_mul_words(self):
|
||||
parse = parse_line('[!] shdad foo')
|
||||
assert parse is not None
|
||||
assert parse['type'] == 'error'
|
||||
assert parse['content'] == 'shdad foo'
|
2
src/qt/.gitignore
vendored
2
src/qt/.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
.*.swp
|
||||
*.pyc
|
||||
TombQt.egg-info
|
||||
build
|
||||
|
46
src/qt/setup.py
Normal file
46
src/qt/setup.py
Normal file
@ -0,0 +1,46 @@
|
||||
import os
|
||||
import glob
|
||||
from setuptools import setup
|
||||
from StringIO import StringIO
|
||||
|
||||
from distutils import log
|
||||
from distutils.core import Command
|
||||
from distutils.dep_util import newer
|
||||
|
||||
class build_ui(Command):
|
||||
# Stolen from picard
|
||||
description = "build Qt UI files"
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
from PyQt4 import uic
|
||||
for uifile in glob.glob("tombqt/*.ui"):
|
||||
pyfile = "ui_%s.py" % os.path.splitext(os.path.basename(uifile))[0]
|
||||
pyfile = os.path.join('tombqt', pyfile)
|
||||
if newer(uifile, pyfile):
|
||||
log.info("compiling %s -> %s", uifile, pyfile)
|
||||
tmp = StringIO()
|
||||
uic.compileUi(uifile, tmp)
|
||||
source = tmp.getvalue()
|
||||
f = open(pyfile, "w")
|
||||
f.write(source)
|
||||
f.close()
|
||||
|
||||
setup(
|
||||
name = 'TombQt',
|
||||
version = '0.1',
|
||||
packages = ['tombqt'],
|
||||
cmdclass = {
|
||||
'build_ui': build_ui
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user