Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
fangpenlin committed May 9, 2015
1 parent 4b04316 commit 6267585
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .gitignore
@@ -0,0 +1,64 @@
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64

# Installer logs
pip-log.txt

# Unit test / coverage reports
cover
.coverage
.tox
nosetests.xml

# Translations
*.mo

# Mrs. Developer
.mr.developer.cfg
.project
.pydevproject
*.sublime-project
*.sublime-workspace

# virtualenv
env

# SQLite database
*.db
*.sqlite

# Vagrant
.vagrant
docs/_build/

# intellij
*.iml
.idea/
.noseids
.tddium*
.elasticbeanstalk/

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml

docker/*.tar
docker/*.txt
39 changes: 39 additions & 0 deletions bugbuzz/__init__.py
@@ -0,0 +1,39 @@
from __future__ import unicode_literals
import sys
import bdb


class BugBuzz(bdb.Bdb):

def interaction(self, frame, traceback=None):
cmd = raw_input('cmd:')
if cmd == 's':
self.set_step()
elif cmd == 'n':
self.set_next(frame)

def user_call(self, frame, argument_list):
"""This method is called when there is the remote possibility
that we ever need to stop in this function."""
print 'user_call', frame
self.interaction(frame)

def user_line(self, frame):
"""This method is called when we stop or break at this line."""
print 'user_line', frame
self.interaction(frame)

def user_return(self, frame, return_value):
"""This method is called when a return trap is set here."""
print 'user_return', frame

def user_exception(self, frame, exc_info):
exc_type, exc_value, exc_traceback = exc_info
"""This method is called if an exception occurs,
but only if we are to stop at or just below this level."""
print 'user_exception', frame



def set_trace():
BugBuzz().set_trace(sys._getframe().f_back)
12 changes: 12 additions & 0 deletions foobar.py
@@ -0,0 +1,12 @@

def foo(bar):
print bar

num = 123

print num
import bugbuzz; bugbuzz.set_trace()
#import pdb; pdb.set_trace()

foo('xxx')
print num * 10
38 changes: 38 additions & 0 deletions setup.py
@@ -0,0 +1,38 @@
from ez_setup import use_setuptools
use_setuptools()

from setuptools import setup, find_packages

version = '0.0.0'
try:
import bugbuzz
version = bugbuzz.__version__
except ImportError:
pass


tests_require = [
'nose',
'nose-cov',
'mock',
'webtest',
'WSGIProxy2',
'requests',
'pytest',
'pytest-cov',
'pytest-xdist',
'pytest-capturelog',
'pytest-mock',
]

setup(
name='bugbuzz',
version=version,
packages=find_packages(),
install_requires=[
],
extras_require=dict(
tests=tests_require,
),
tests_require=tests_require,
)

0 comments on commit 6267585

Please sign in to comment.