Skip to content

Commit

Permalink
Renamed Prompt class module to prompt.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ltn100 committed Oct 25, 2014
1 parent 2fd4083 commit e630cf6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bin/prompty
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def main(argv=None):

s = prompty.status.Status(exitStatus, workingDir)

p = prompty.prompty.Prompt(s)
p = prompty.prompt.Prompt(s)

# Encode unicode to UTF-8 for terminal printing
prompt = p.getPrompt().encode("utf8")
Expand Down
2 changes: 1 addition & 1 deletion prompty/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:

import prompty
import prompt
import functions
import colours
import compiler
Expand Down
File renamed without changes.
13 changes: 7 additions & 6 deletions test/test_prompty.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
# If we are running this from the source prompty dir then use
# the source prompty module. Otherwise try to import the system
# installed package
if os.path.isdir("prompty") and os.path.isdir("test"):
if os.path.isdir("prompty") and os.path.isdir("test") and os.path.isdir("bin"):
sys.path[0:0] = [os.getcwd()]
prompty_exec = os.path.join("bin", "prompty")
else:
prompty_exec = distutils.spawn.find_executable("prompty")

import prompty
if 'colours' not in dir(prompty):
Expand All @@ -47,8 +50,6 @@
# 'prompty.py' (we want the package)
raise ImportError


prompty_exec = distutils.spawn.find_executable("prompty")
if not prompty_exec:
# If prompty not found in the system path get the version from the bin dir
prompty_exec = os.path.join(TEST_DIR, "..", "bin", "prompty")
Expand Down Expand Up @@ -841,11 +842,11 @@ def test_colourLiteral(self):

class PromptTests(UnitTestWrapper):
def test_create(self):
p = prompty.prompty.Prompt(prompty.status.Status())
self.assertIsInstance(p, prompty.prompty.Prompt)
p = prompty.prompt.Prompt(prompty.status.Status())
self.assertIsInstance(p, prompty.prompt.Prompt)

def test_getPrompt(self):
p = prompty.prompty.Prompt(prompty.status.Status())
p = prompty.prompt.Prompt(prompty.status.Status())
s = p.getPrompt()
self.assertIsInstance(s, basestring)
self.assertGreater(len(s), 0)
Expand Down

0 comments on commit e630cf6

Please sign in to comment.