semvec/pypi-packages huggingface dataset:
django-postmark 0.1.6
A Django reusable app to send email with postmark, as well as models and views to handle bounce integration.
License: BSD

Django Postmark
===============

django-postmark is a reusable app that includes an EmailBackend for sending email
with Django as well as models and view that enable integration with Postmark's
bounce hook api.

Installation
------------

You can install django postmark with pip by typing::

    pip install django-postmark
    
Or with easy_install by typing::

    easy_install django-postmark
    
Or manually by downloading a tarball and typing::

    python setup.py install
    
Once installed add `postmark` to your `INSTALLED_APPS` and run::

    python manage.py syncdb

Or if you are using south::

    python manage.py migrate
    
Django Configuration
--------------------

If you want to use django-postmark as your default backend, you should add::

    EMAIL_BACKEND = "postmark.backends.PostmarkBackend"

to your settings.py

Settings
--------

django-postmark adds 1 required setting and 2 optional settings.

Required:
    Specifies the api key for your postmark server.::

        POSTMARK_API_KEY = 'POSTMARK_API_TEST'
    
Optional:
    Specifies a username and password that the view will require to be passed
    in via basic auth. (http://exampleuser:examplepassword@example.com/postmark/bounce/)::
    
        POSTMARK_API_USER = "exampleuser"
        POSTMARK_API_PASSWORD = "examplepassword"
    
Postmark Bounce Hook
--------------------

Postmark has the optional ability to POST to an url anytime a message you have
sent bounces. django-postmark comes with an urlconf and view for this purpose. If
you wish to use this then add::

    url(r"^postmark/", include("postmark.urls")),
    
to your root urls.py. This will cause your bounce hook location to live
at /postmark/bounce/. Then simply add in the url to your Postmark settings (with
the username and password specified by POSTMARK_API_USER/PASSWORD if set) and
django will accept POSTS from Postmark notifying it of a new bounce.
pygdb2 0.1
Control GDB from within the Python program being debugged
License: BSD

.. -*- restructuredtext -*-

pygdb2: control GDB from within the Python program being debugged
==================================================================

``pygdb2`` is a python module which allows you to send commands to the
underlying ``gdb`` process.  For example, it can be used to automatically and
programmatically add breakpoints and watchpoints.

How to install
--------------

Make sure that ``pygdb2`` is installed::

    $ pip install pygdb2

Then, you need to activate the GDB integration by putting this line inside
your ``~/.gdbinit``::

    python import pygdb2


How to use it
--------------

You need to launch your python program inside ``gdb`` using the special
``pyrun`` command::

    $ gdb --args python myscript.py
    ...
    (gdb) pyrun
    ...

From the python program, you can use ``pygdb2.set_trace()`` to enter the ``gdb``
prompt, or ``pygdb2.execute()`` to send commands to ``gdb``.

At the ``(gdb)`` prompt, it is possible to invoke the ``pdb`` command to enter
in the corresponding debugger at the Python level.


Example
-------

For example, the following code adds a watchpoint for a particular
region of memory created with ``ctypes``::

    import ctypes
    import pygdb2

    def main():
        buf = ctypes.c_int()
        buf.value = 42
        adr = ctypes.cast(ctypes.pointer(buf), ctypes.c_void_p)
        # enter gdb when we write to this memory
        pygdb2.execute("watch *(int*)%d" % adr.value)

        i = 0
        while i < 5:
            print i
            i += 1
            if i == 2:
                buf.value = 43 # GDB stops here

Here is an example of a gdb/pdb session::

    $ gdb --args python set_watchpoint.py
    ...
    (gdb) # lines prefixed "pygdb2:" contain the command coming from pygdb2.execute()
    (gdb) pyrun
    ...
    pygdb2: watch *(int*)14079984
    Hardware watchpoint 1: *(int*)14079984
    0
    1
    Hardware watchpoint 1: *(int*)14079984

    Old value = 42
    New value = 43
    i_set (ptr=0xd6d7f0, value=<value optimized out>, size=4) at /build/buildd/python2.7-2.7.1/Modules/_ctypes/cfield.c:663
    663	/build/buildd/python2.7-2.7.1/Modules/_ctypes/cfield.c: No such file or directory.
        in /build/buildd/python2.7-2.7.1/Modules/_ctypes/cfield.c

    (gdb) # now we are debugging at the C level
    (gdb) # in particular, we are inside function of _ctypes
    (gdb) # which sets the value of the buffer

    (gdb) # Let's jump to the Python level
    (gdb) pdb
    Signal received, entering pdb
    Traceback:
      File "set_watchpoint.py", line 20, in <module>
        main()
      File "set_watchpoint.py", line 16, in main
        buf.value = 43 # we should enter gdb here
    > /home/antocuni/env/src/pygdb2/pygdb2/test/set_watchpoint.py(12)main()
    -> while i < 5:
    (Pdb++) print i
    2
    (Pdb++) c
    2
    3
    4

    Program exited normally.
    (gdb) q



Using signals
-----------------

``pygdb2`` uses both ``SIGUSR1`` and ``SIGUSR2`` to communicate with ``gdb``,
so if your program also needs those, you might have conflicts.