Skip to content
This repository has been archived by the owner on Nov 16, 2018. It is now read-only.

Commit

Permalink
Added some test files
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrochh committed Jun 5, 2012
1 parent 6e3db4b commit f9942b7
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
File renamed without changes.
49 changes: 49 additions & 0 deletions demo.py
@@ -0,0 +1,49 @@
"""Module for testing some python-mode features."""
import os

from utils import set_breakpoint
# from utils import does_not_exist


def main(*args, **kwargs):
"""See? We got nice syntax highting."""
print 'Hello world'
set_breakpoint(42, 42, data={'key': 'value', })

def fold_this():
"""We can fold code blocks by pressing ``f``."""
print 'Fold it.'


def fold_all():
"""We can fold everything by pressing ``F``."""
print 'Fold all.'


def create_ropeproject():
"""We would create a ropeproject by executing ``:RopeOpenProject``."""
print 'Now add your venv to ``.ropeproject/config.py``!'


def life_syntax_checking():
"""Pylint checks our code on each save."""
# Try to uncomment this and save.
# Try to uncomment the os import and save.
# Try to uncomment the does_not_exist imort and save.
# abc = 5


def code_completion():
"""Code completion makes life easy."""
# Try to call one of our methods here.
# Try to import something from utils


def open_utils_py():
"""We can use Ctlp to open files in our project."""
print 'Open ``utils.py`` in a new vertical split via ``<C-p>ut<C-v>``'
print 'Now open ``utils.py`` in a new tab via ``<C-p>ut<C-t>``.'


if __name__ == '__main__':
main()
5 changes: 5 additions & 0 deletions test.py
@@ -0,0 +1,5 @@
import os




34 changes: 34 additions & 0 deletions utils.py
@@ -0,0 +1,34 @@
"""Another file in our package."""
from urlparse import urljoin


def print_twitter_url():
"""We can lookup the urljoin method via ``<Leader>g``."""
print urljoin('http://www.twitter.com', 'mbrochh')


def try_to_import_from_demo_py():
"""Code completion makes importing easy!"""
print 'Try to import that method which starts with ``open_``.'


def set_breakpoint(arg1, arg2, data=None):
"""We can set breakpoints via ``<Leader>b``."""
foo = 'bar'
result = arg1 + arg2
import ipdb; ipdb.set_trace() # BREAKPOINT
print 'Try to set a breakpoint before this statement.'
print 'Then run ``python demo.py``.'
import ipdb; ipdb.set_trace() # BREAKPOINT
print 'Good bye!'
# ?
# help a
# a
# l
# next
# inspect data
# bt
# u
# s
# c
# exit

0 comments on commit f9942b7

Please sign in to comment.