[patch] Add support for passing args to the debugged script (python)
オープン
- 主要言語
- Python
- スター
- 284
- フォーク
- 27
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Example:
:Dbg ". hello world"
Executes the current script with "hello world" as arguments.
Patch supplied:
diff -Naur orig//commands.py new//commands.py
--- orig//commands.py 2011-01-27 13:19:39.366748310 -0300
+++ new//commands.py 2011-01-27 13:17:35.066748310 -0300
@@ -62,7 +62,7 @@
if debugger and debugger.started:
return
if url is not None:
- if url in ('.', '-'):
+ if url[0] in ('.', '-'):
pass
elif url.isdigit():
urls = load_urls()
@@ -81,11 +81,11 @@
debugger.init_vim()
global _commands
_commands = debugger.commands()
- if url == '.':
+ if url[0] == '.':
if not (os.path.exists(fname) and fname.endswith('.py')):
print 'Current file is not python (or doesn\'t exist on your hard drive)'
return
- debugger.start_py(fname)
+ debugger.start_py(fname + url[1:])
elif url == '-':
debugger.start()
else:
diff -Naur orig//new_debugger.py new//new_debugger.py
--- orig//new_debugger.py 2011-01-27 13:19:47.722748309 -0300
+++ new//new_debugger.py 2011-01-27 13:21:15.702748310 -0300
@@ -113,7 +113,7 @@
return self.start()
def start_py(self, fname):
- subprocess.Popen(('pydbgp.py', '-d', 'localhost:9000', fname), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ subprocess.Popen(('pydbgp.py', '-d', 'localhost:9000') + tuple(fname.split()), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
self._type = 'python'
return self.start()
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず commands.py の :Dbg 処理と new_debugger.py の start_py エントリーポイントを確認し、その後、提供されたパッチを現在のファイルと比較します。例の呼び出しで、要求された引数を指定して現在の Python スクリプトが実行されること、また既存のデバッガーの動作が維持されることを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100