Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    pyplete 0.0.5

    Download button

    No screenshots available
    Downloads: 91  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Pablo Martin | More programs
    LGPL / FREE
    September 4th, 2012, 23:33 GMT [view history]
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    pyplete description

    An interface to autocomplete in Python

    pyplete is an interface to autocomplete in Python.

    Installation

    - Install Pysmell
    - Install pyplete

    easy_install pysmell==0.7.3
    easy_install pyplete==0.0.1

    Usage (examples)

    Get the top level importable package and modules:

    In [1]: from pyplete import PyPlete
    In [2]: pyplete = PyPlete()
    In [3]: importables = []
    In [4]: autocompletes = pyplete.get_importables_top_level(importables)
    In [5]: autocompletes
    Out[5]: True
    In [6]: importables
    Out[6]:
    [('smtpd', 'module'),
     ('virtualenv', 'module'),
     ('virtualenv_support', 'package'),
     ('jinja2', 'package'),
     ('geopy', 'package'),
     ('dateutil', 'package'),
     ('pep8', 'module'),
     ('johnny', 'package'),
     ('django_like', 'package'),
     ('django', 'package'),
     ...]


    Get the importable subpackages:

    In [7]: importables = []
    In [8]: autocompletes = pyplete.get_importables_rest_level(importables, "django", into_module=False)
    In [9]: autocompletes
    Out[9]: True
    In [10]: importables
    Out[10]:
    [('bin', 'package'),
    ('conf', 'package'),
    ('contrib', 'package'),
    ('core', 'package'),
    ('db', 'package'),
    ('dispatch', 'package'),
    ('forms', 'package'),
    ('http', 'package'),
    ('middleware', 'package'),
    ('shortcuts', 'package'),
    ('template', 'package'),
    ('templatetags', 'package'),
    ('test', 'package'),
    ('test.pystone', 'module'),
    ('test.regrtest', 'module'),
    ('test.test_support', 'module'),
    ('utils', 'package'),
    ('views', 'package'),
    ('VERSION', 'constant')]


    Get the importable names:

    In [7]: importables = []
    In [8]: autocompletes = pyplete.get_importables_rest_level(importables, "django")
    In [9]: autocompletes
    Out[9]: True
    In [10]: importables
    Out[10]:
    [('bin', 'package'),
    ('conf', 'package'),
    ('contrib', 'package'),
    ('core', 'package'),
    ('db', 'package'),
    ('dispatch', 'package'),
    ('forms', 'package'),
    ('http', 'package'),
    ('middleware', 'package'),
    ('shortcuts', 'package'),
    ('template', 'package'),
    ('templatetags', 'package'),
    ('test', 'package'),
    ('test.pystone', 'module'),
    ('test.regrtest', 'module'),
    ('test.test_support', 'module'),
    ('utils', 'package'),
    ('views', 'package'),
    ('get_version', 'function', ' ()', ''), # This is the difference
    ('VERSION', 'constant')]


    Other example to the importable names:

    In [11]: importables = []
    In [12]: autocompletes = pyplete.get_importables_rest_level(importables, "django", ["contrib", "auth", "models"], into_module=True)
    Out[12]:
    [('get_hexdigest',
    'function',
    ' (algorithm, salt, raw_password)',
    "\n Returns a string of the hexdigest of the given plaintext password and salt\n using the given algorithm ('md5', 'sha1' or 'crypt').\n "),
    ...
    ('User',
    'class',
    ' ()',
    '\n Users within the Django authentication system are represented by this model.\n\n Username and password are required. Other fields are optional.\n '),
    ('PermissionManager', 'class', ' ()', ''),
    ('Permission',
    'class',
    ' ()',
    'The permissions system provides a way to assign permissions to specific users and groups of users.\n\n The permission system is used by the Django admin site, but may also be useful in your own code. The Django admin site uses permissions as follows:\n\n - The "add" permission limits the user\'s ability to view the "add" form and add an object.\n - The "change" permission limits a user\'s ability to view the change list, view the "change" form and change an object.\n - The "delete" permission limits the ability to delete an object.\n\n Permissions are set globally per type of object, not per specific object instance. It is possible to say "Mary may change news stories," but it\'s not currently possible to say "Mary may change news stories, but only the ones she created herself" or "Mary may only change news stories that have a certain status or publication date."\n\n Three basic permissions -- add, change and delete -- are automatically created for each Django model.\n '),
    ...
    ('AnonymousUser', 'class', ' ()', ''),
    ('UNUSABLE_PASSWORD', 'constant')]

    Get names importables from a text:

    In [13]: importables = []
    In [14]: text = """class A(object):
    ....: def __init__(self, x, y, z):
    ....: self.x = x
    ....: self.y = y
    ....: self.z = z
    ....: def xxx(self, a):
    ....: return a
    ....: def myfunc(u, v):
    ....: return u + v"""
    In [15]: autocompletes = pyplete.get_importables_from_text(importables, text)
    In [16]: importables
    Out[16]:
    [('myfunc', 'function', ' (u, v)', ''),
    ('A', 'class', ' (x, y, z)', '')]

    Get names importables from a line:

    In [17]: importables = []
    In [18]: text = "import requests"
     line = "requests.models."
    In [19]: pyplete.get_importables_from_line(importables, text, line)
    Out[19]:
    [('Request',
    'class',
    ' (url=None, headers=dict(), files=None, method=None, data=dict(), params=dict(), auth=None, cookies=None, timeout=None, redirect=False, allow_redirects=False, proxies=None, hooks=None, config=None, prefetch=False, _poolmanager=None, verify=None, session=None, cert=None)',
    'The :class:`Request < Request >` object. It carries out all functionality of\n Requests. Recommended interface is with the Requests functions.\n '),
    ('Response',
    'class',
    ' ()',
    'The core :class:`Response < Response >` object. All\n :class:`Request < Request >` objects contain a\n :class:`response < Response >` attribute, which is an instance\n of this class.\n '),
    ('chardet', 'constant'),
    ('REDIRECT_STATI', 'constant'),
    ('CONTENT_CHUNK_SIZE', 'constant')]



    Product's homepage

    Requirements:

    · Python
    · PySmell

    What's New in This Release: [ read full changelog ]

    · Finally fix a little error in get_pysmell_code_walk_to_text (only if the text was unicode characters).

      


    TAGS:

    autocomplete interface | Python library | Python | autocomplete | interface

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM