Skip to content

Commit ff4b47e

Browse files
4B796C65@gmail.com4B796C65@gmail.com
authored andcommitted
Numerous changes
1 parent b71bb5e commit ff4b47e

File tree

9 files changed

+378
-493
lines changed

9 files changed

+378
-493
lines changed

examples/interactive.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ def write(self, string):
2626
for string in textwrap.wrap(strings, 80):
2727
scroll()
2828
console.drawStr(0, HEIGHT-1, string, *self.colors)
29+
tdl.flush()
2930

3031
sys.stdout = TDLPrint()
3132
olderr = sys.stderr
3233
newerr = TDLPrint((255, 255, 255), (127, 0, 0))
3334
interpeter = code.InteractiveConsole({'tdl':tdl, 'console':console})
35+
print('Python %s' % sys.version)
3436
print('Press ESC to quit')
3537
if __name__ == '__main__':
3638
buffer = ''
@@ -66,7 +68,8 @@ def write(self, string):
6668
sys.excepthook(*sys.exc_info())
6769
banner = sys.ps1
6870
sys.stderr = olderr
69-
commands.append(buffer)
71+
if buffer not in commands:
72+
commands.append(buffer)
7073
buffer = ''
7174
elif event.ctrl:
7275
pass
@@ -96,7 +99,7 @@ def write(self, string):
9699
buffer = commands.pop(0)
97100
cursor = len(buffer)
98101
elif event.char == '\t':
99-
buffer += ' '
102+
buffer = buffer[:cursor] + ' ' + buffer[cursor:]
100103
cursor += 4
101104
elif event.keyname == 'ESCAPE':
102105
raise SystemExit()

setup.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
#!/usr/bin/env python
22

3+
import os.path
34
import subprocess
45
from distutils.core import setup
56

67
def getVersion():
78
"""getting the latest revision number from svn is a pain
89
when setup.py is run this function is called and sets up the tdl/VERSION file
9-
when run from an sdist build the svn isn't found and uses the stored version instead
10+
when run from an sdist build the svn data isn't found and uses the stored version instead
1011
"""
11-
svnversion = subprocess.Popen('svnversion -n', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
12-
REVISION = svnversion.communicate()[0] # get stdout
12+
REVISION = None
13+
if os.path.exists('.svn'): # if .svn/ doesn't even exist, don't bother running svnversion
14+
svnversion = subprocess.Popen('svnversion -n', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
15+
REVISION = svnversion.communicate()[0] # get stdout
16+
1317
if not REVISION or not any([c.isdigit() for c in REVISION]):
1418
# no numbers so assume an error
15-
# likely a real user install, get version from file
19+
# but likely a real user install, so get version from file
1620
VERSION = open('tdl/VERSION', 'r').read()
1721
return VERSION
1822
# building on the svn, save version in a file for user installs
1923
if b':' in REVISION:
2024
REVISION = REVISION.split(b':')[-1] # take "latest" revision, I think
2125
REVISION = b''.join((c for c in REVISION if c.isdigit())) # remove letters
22-
VERSION = '1.1r%s' % REVISION
26+
VERSION = '1.0r%s' % REVISION
2327
open('tdl/VERSION', 'w').write(VERSION)
2428
return VERSION
2529

0 commit comments

Comments
 (0)