Skip to content

Commit

Permalink
put basic/ and interface into pcbasic/ top-level package and reintrod…
Browse files Browse the repository at this point in the history
…uce runner script
  • Loading branch information
robhagemans committed May 10, 2016
1 parent a2bd782 commit 8c2fc13
Show file tree
Hide file tree
Showing 150 changed files with 41 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
@@ -1,3 +1,3 @@
[submodule "ansipipe"]
path = ansipipe
path = pcbasic/ansipipe
url = git://github.com/robhagemans/ansipipe.git
2 changes: 1 addition & 1 deletion docsrc/makeusage.py
Expand Up @@ -61,7 +61,7 @@ def parse_element(e, blocklist):
def makeusage():
usage_html = open(basepath + '/options.html', mode='r').read()
# output usage
with open(basepath + '/../USAGE.txt', 'w') as textfile:
with open(basepath + '/../pcbasic/USAGE.txt', 'w') as textfile:
textfile.write(html_to_text(usage_html))

if __name__ == '__main__':
Expand Down
6 changes: 6 additions & 0 deletions pcbasic/__init__.py
@@ -0,0 +1,6 @@
"""
PC-BASIC - GW-BASIC/BASICA/Cartridge BASIC compatible interpreter
(c) 2013, 2014, 2015, 2016 Rob Hagemans
This file is released under the GNU GPL version 3 or later.
"""
10 changes: 4 additions & 6 deletions pcbasic.py → pcbasic/__main__.py
@@ -1,5 +1,3 @@
#!/usr/bin/env python2

"""
PC-BASIC - GW-BASIC/BASICA/Cartridge BASIC compatible interpreter
Expand All @@ -23,10 +21,10 @@
# NOTE that this affects str.upper() etc.
locale.setlocale(locale.LC_ALL, '')

import ansipipe
import basic
import interface
from interface import config
from . import ansipipe
from . import basic
from . import interface
from . import config


def main():
Expand Down
Submodule ansipipe updated from 000000 to 4f1908
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions interface/config.py → pcbasic/config.py
Expand Up @@ -21,7 +21,7 @@
import ctypes
import ctypes.wintypes

from basic import __version__, codepages, fonts
from .basic import __version__, codepages, fonts

# get basepath (__file__ is undefined in pyinstaller packages)
if hasattr(sys, 'frozen'):
Expand All @@ -46,7 +46,7 @@ def get_logger(logfile=None):

def show_usage():
"""Show usage description."""
usage_file = os.path.join(basepath, '..', 'USAGE.txt')
usage_file = os.path.join(basepath, 'USAGE.txt')
with open(usage_file) as f:
for line in f:
sys.stdout.write(line)
Expand Down
2 changes: 1 addition & 1 deletion interface/__init__.py → pcbasic/interface/__init__.py
Expand Up @@ -26,7 +26,7 @@
from .audio_sdl2 import AudioSDL2

# create the window icon
from basic import typeface
from ..basic import typeface
icon_hex = '00003CE066606666666C6678666C3CE67F007F007F007F007F007F007F000000'
icon = typeface.Font(16, {'icon': icon_hex.decode('hex')}
).build_glyph('icon', 16, 16, False, False)
Expand Down
File renamed without changes.
Expand Up @@ -10,7 +10,7 @@
import subprocess
import platform

from basic import signals
from ..basic import signals
from . import base as audio


Expand Down
Expand Up @@ -9,7 +9,7 @@
import datetime
import Queue

from basic import signals
from ..basic import signals
from . import base as audio


Expand Down
Expand Up @@ -25,7 +25,7 @@
import logging
import Queue

from basic import signals
from ..basic import signals
from . import base as audio

tick_ms = 24
Expand Down
Expand Up @@ -23,7 +23,7 @@
except ImportError:
numpy = None

from basic import signals
from ..basic import signals
from . import base as audio

tick_ms = 24
Expand Down
2 changes: 1 addition & 1 deletion interface/base.py → pcbasic/interface/base.py
Expand Up @@ -8,7 +8,7 @@

import Queue

from basic import signals
from ..basic import signals


class InitFailed(Exception):
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions interface/video_cli.py → pcbasic/interface/video_cli.py
Expand Up @@ -16,9 +16,9 @@
from . import base as video
from . import ansi

from basic import signals
from basic import scancode
from basic.eascii import as_unicode as uea
from ..basic import signals
from ..basic import scancode
from ..basic.eascii import as_unicode as uea

encoding = sys.stdin.encoding or 'utf-8'

Expand Down
Expand Up @@ -14,9 +14,9 @@
except ImportError:
curses = None

from basic import scancode
from basic.eascii import as_unicode as uea
from basic import signals
from ..basic import scancode
from ..basic.eascii import as_unicode as uea
from ..basic import signals

from . import base as video
# for a few ansi sequences not supported by curses
Expand Down
Expand Up @@ -25,8 +25,8 @@

from . import base as video

from basic import signals
from basic import scancode
from ..basic import signals
from ..basic import scancode

# percentage of the screen to leave unused for window decorations etc.
display_slack = 15
Expand Down
Expand Up @@ -11,7 +11,7 @@

from . import base as video

from basic import signals
from ..basic import signals

if platform.system() == 'Windows':
from msvcrt import kbhit
Expand Down
Expand Up @@ -19,9 +19,9 @@
except ImportError:
numpy = None

from basic import signals
from basic import scancode
from basic.eascii import as_unicode as uea
from ..basic import signals
from ..basic import scancode
from ..basic.eascii import as_unicode as uea

from . import clipboard
from . import base as video
Expand Down
6 changes: 3 additions & 3 deletions interface/video_sdl2.py → pcbasic/interface/video_sdl2.py
Expand Up @@ -24,9 +24,9 @@
except ImportError:
numpy = None

from basic import signals
from basic import scancode
from basic.eascii import as_unicode as uea
from ..basic import signals
from ..basic import scancode
from ..basic.eascii import as_unicode as uea
from . import clipboard
from . import base as video
from . import video_graphical
Expand Down
4 changes: 4 additions & 0 deletions run-pcbasic.py
@@ -0,0 +1,4 @@
#!/usr/bin/env python2

from pcbasic.__main__ import main
main()
2 changes: 1 addition & 1 deletion test/lint.sh
@@ -1,2 +1,2 @@
#!/bin/bash
for file in ../basic/*.py ../interface/*.py ../pcbasic.py; do pylint -E --ignored-modules=pygame,numpy,pygame.mixer --enable=cyclic-import,relative-import --disable=too-many-function-args $file; done
for file in ../pcbasic/*.py ../pcbasic/*/*.py; do pylint -E --ignored-modules=pygame,numpy,pygame.mixer --enable=cyclic-import,relative-import --disable=too-many-function-args $file; done
2 changes: 1 addition & 1 deletion test/test.sh
Expand Up @@ -24,7 +24,7 @@ do
mkdir "$name/output"
cp "$name"/* "$name/output" 2>/dev/null
pushd "$name/output" > /dev/null
../../../pcbasic.py --interface=none >/dev/null
../../../run-pcbasic.py --interface=none >/dev/null
popd > /dev/null
pass=1
known=1
Expand Down

0 comments on commit 8c2fc13

Please sign in to comment.