Convert yml2 into a Python package.

* Rename yml2.py    -> yml2/__init__.py
* Rename backend.py -> yml2/backend.py
* Rename pyPEG.py   -> yml2/pyPEG.py
* Use relative imports where appropriate.
* Change imports in yml2c, yml2proc.
* Update make target `clean`.
Hartmut Goebel 3 years ago
parent 44d85b7088
commit d589862910

@ -10,11 +10,11 @@ update: homepage format.css gpl-2.0.txt
update-all: update yml2c yml2.py pyPEG.py backend.py yml2proc
if test -z $(VERSION) ; then echo VERSION not set ; exit 1 ; fi
rsync -avC *.py yml2c Makefile yml2proc xml2yml.ysl2 standardlib.ysl2 samples dragon:fdik.org/yml2/
ssh dragon bash -c "cd ; cd fdik.org/; tar cvjf yml-$(VERSION).tar.bz2 yml2/{*.py,*.yml2,*.yhtml2,format.css,gpl-2.0.txt,yml2c,Makefile,yml2proc,xml2yml.ysl2,standardlib.ysl2,samples} ; rm yml2.tar.bz2 ; ln -s yml-$(VERSION).tar.bz2 yml2.tar.bz2"
rsync -avC *.py yml2 yml2c Makefile yml2proc xml2yml.ysl2 standardlib.ysl2 samples dragon:fdik.org/yml2/
ssh dragon bash -c "cd ; cd fdik.org/; tar cvjf yml-$(VERSION).tar.bz2 yml2/{*.py,*.yml2,*.yhtml2,format.css,gpl-2.0.txt,yml2,yml2c,Makefile,yml2proc,xml2yml.ysl2,standardlib.ysl2,samples} ; rm yml2.tar.bz2 ; ln -s yml-$(VERSION).tar.bz2 yml2.tar.bz2"
%.html: %.en.yhtml2 heading.en.yhtml2 homepage.en.yhtml2
$(YML2C) $< -o $@
clean:
rm -f *.html *.pyc *.pyo
rm -f *.html *.pyc *.pyo */*.pyc */*.pyo

@ -3,7 +3,7 @@
# written by VB.
import re
from pyPEG import keyword, _and, _not
from .pyPEG import keyword, _and, _not
# pyPEG:
#

@ -8,8 +8,8 @@ import sys, traceback, os
from xml.sax.saxutils import escape, quoteattr
from copy import copy, deepcopy
from glob import glob
from pyPEG import code, parse, parseLine, u, Symbol
from yml2 import ymlCStyle, comment, _inner
from .pyPEG import code, parse, parseLine, u, Symbol
from . import ymlCStyle, comment, _inner
ymlFunc, pointers, pythonFunc = {}, {}, {}
in_ns = ""

@ -11,9 +11,9 @@ import sys, os, codecs, locale
import fileinput, unicodedata
from optparse import OptionParser
from pyPEG import parse, u
from yml2.pyPEG import parse, u
from yml2 import ymlCStyle, comment, oldSyntax
import backend
import yml2.backend as backend
def printInfo(option, opt_str, value, parser):
sys.stdout.write(__doc__)

@ -18,8 +18,8 @@ except:
sys.exit(1)
from yml2 import ymlCStyle, comment, oldSyntax
from pyPEG import parse, u
import backend
from yml2.pyPEG import parse, u
import yml2.backend as backend
def printInfo(option, opt_str, value, parser):
sys.stdout.write(__doc__)

Loading…
Cancel
Save