Permalink
Browse files

phpsh 1.3; no duplication with version; dbgp becomes actual script

Summary: it looks like the python installer will no longer leave
dbgp.py executable, probably to enforce standards and stop ppl like
us.  so now we do the "right thing" and make dbgp.py an actual
"script" in setup.py.  also give it longer name dbgp-phpsh.py.

Reviewed By: ccheever

Test Plan: phpsh --version, fb redeploy, stuff in and out of www/, d

Revert Plan: ok
  • Loading branch information...
1 parent 45641a9 commit 1bc1c018c9fb7ab08d3df108467645b9cca0109f Daniel Corson committed Mar 23, 2010
Showing with 19 additions and 15 deletions.
  1. +5 −2 setup.py
  2. +7 −3 src/__init__.py
  3. 0 src/{dbgp.py → dbgp-phpsh.py}
  4. +7 −10 src/phpsh
View
@@ -4,6 +4,9 @@
import sys
import os
+sys.path.insert(0, 'src')
+from phpsh import __version__
+
if len(sys.argv) > 1 and sys.argv[1] == "build":
build_root = os.path.dirname(os.path.realpath(__file__))
make_dir = os.path.join(build_root, "src/xdebug-clients/geben")
@@ -18,7 +21,7 @@
setup(
name="phpsh",
- version="1.2",
+ version=__version__,
description="interactive shell into a php codebase",
author="facebook",
author_email="phpsh@googlegroups.com",
@@ -33,7 +36,7 @@
"xdebug-clients/geben/geben.elc",
"xdebug-clients/geben/help",
"xdebug-clients/geben/tree-widget/geben/*.png"]},
- scripts=["src/phpsh"],
+ scripts=["src/phpsh", "src/dbgp-phpsh.py"],
data_files=[
(config_dir, ["src/rc.php", "src/php_manual.db", "src/config.sample"]),
("man/man1", ["src/doc/phpsh.1"]),
View
@@ -1,3 +1,7 @@
+__version__ = "1.3"
+__author__ = "phpsh@googlegroups.com"
+__date__ = "Nov 20, 2008"
+
from subprocess import Popen, PIPE
from threading import Thread
import ansicolor as clr
@@ -308,8 +312,6 @@ class PhpshState:
full php line) at phpsh.
"""
- phpsh_root = os.path.dirname(os.path.realpath(__file__))
-
php_prompt = "php> "
php_more_prompt = " ... "
@@ -323,6 +325,8 @@ def __init__(self, cmd_incs, do_color, do_echo, codebase_mode,
"""start phpsh.php and do other preparations (colors, ctags)
"""
+ self.phpsh_root = os.path.dirname(os.path.realpath(__file__))
+
self.do_echo = do_echo
self.p_dbgp = None; # debugging proxy
self.dbgp_port = 9000; # default port on which dbgp proxy listens
@@ -533,7 +537,7 @@ def start_xdebug_proxy(self):
try:
to_r, to_w = os.pipe()
from_r, from_w = os.pipe()
- dbgp_py = [os.path.join(self.phpsh_root, "dbgp.py"),
+ dbgp_py = ["dbgp-phpsh.py",
str(to_r), str(to_w), str(from_r), str(from_w)]
self.p_dbgp = Popen(dbgp_py)
os.close(to_r)
File renamed without changes.
View
@@ -1,11 +1,7 @@
#!/usr/bin/env python
-__version__ = "1.2"
-__author__ = "phpsh@googlegroups.com"
-__date__ = "Nov 20, 2008"
-
from optparse import OptionParser
-from phpsh import PhpshState, PhpMultiliner, do_sugar, line_encode
+from phpsh import PhpshState, PhpMultiliner, do_sugar, line_encode, __version__
import sys
import os
@@ -18,10 +14,11 @@ See /etc/phpsh/rc.php for other codebase modes.""")
p.add_option("-t", "--test-file",
help="""Run a saved-phpsh-session unit test file.
See test/ in the phpsh distribution for examples.""")
-p.add_option("-v", "--verbose", action="store_true",
- help="""Be more verbose, do not defer warnings about missing extensions.""")
+p.add_option("-v", "--verbose", action="store_true", help=
+ """Be more verbose, do not defer warnings about missing extensions.""")
-# are we cool with these negated opts? at least they indicate the defaults..
+# are we cool with these negated opts?
+# at least they indicate the defaults..
p.add_option("-A", "--no-autocomplete", action="store_true")
p.add_option("-C", "--no-color", action="store_true")
p.add_option("-M", "--no-multiline", action="store_true")
@@ -45,7 +42,8 @@ s = PhpshState(cmd_incs=set(cmd_incs),
if opts.test_file:
# TODO support multiline in test-mode
- # TODO? test-mode shouldn't support r/c/i etc should it? maybs r? but q?
+ # TODO? test-mode shouldn't support r/c/i etc should it? maybs r?
+ # but q?
# parse test file
# this is not perfect since output lines could start with "php> " (!!)
test_f = file(opts.test_file)
@@ -155,4 +153,3 @@ while True:
else:
new_expr = False
s.close()
-

0 comments on commit 1bc1c01

Please sign in to comment.