This repository has been archived by the owner on Nov 16, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import os | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |