Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

Location:
python/vendor/current/Doc/includes
Files:
3 added
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Doc/includes/email-alternative.py

    r2 r388  
    1 #! /usr/bin/python
     1#!/usr/bin/env python
    22
    33import smtplib
  • python/vendor/current/Doc/includes/email-dir.py

    r2 r388  
    106106        fp.close()
    107107    else:
    108         s = smtplib.SMTP()
     108        s = smtplib.SMTP('localhost')
    109109        s.sendmail(opts.sender, opts.recipients, composed)
    110110        s.quit()
  • python/vendor/current/Doc/includes/email-mime.py

    r2 r388  
    2727
    2828# Send the email via our own SMTP server.
    29 s = smtplib.SMTP()
     29s = smtplib.SMTP('localhost')
    3030s.sendmail(me, family, msg.as_string())
    3131s.quit()
  • python/vendor/current/Doc/includes/email-simple.py

    r2 r388  
    2020# Send the message via our own SMTP server, but don't include the
    2121# envelope header.
    22 s = smtplib.SMTP()
     22s = smtplib.SMTP('localhost')
    2323s.sendmail(me, [you], msg.as_string())
    2424s.quit()
  • python/vendor/current/Doc/includes/email-unpack.py

    r2 r388  
    3636    try:
    3737        os.mkdir(opts.directory)
    38     except OSError, e:
     38    except OSError as e:
    3939        # Ignore directory exists error
    4040        if e.errno != errno.EEXIST:
  • python/vendor/current/Doc/includes/minidom-example.py

    r2 r388  
    2020
    2121def getText(nodelist):
    22     rc = ""
     22    rc = []
    2323    for node in nodelist:
    2424        if node.nodeType == node.TEXT_NODE:
    25             rc = rc + node.data
    26     return rc
     25            rc.append(node.data)
     26    return ''.join(rc)
    2727
    2828def handleSlideshow(slideshow):
  • python/vendor/current/Doc/includes/sqlite3/complete_statement.py

    r2 r388  
    2424            if buffer.lstrip().upper().startswith("SELECT"):
    2525                print cur.fetchall()
    26         except sqlite3.Error, e:
     26        except sqlite3.Error as e:
    2727            print "An error occurred:", e.args[0]
    2828        buffer = ""
  • python/vendor/current/Doc/includes/sqlite3/ctx_manager.py

    r2 r388  
    99
    1010# con.rollback() is called after the with block finishes with an exception, the
    11 # exception is still raised and must be catched
     11# exception is still raised and must be caught
    1212try:
    1313    with con:
  • python/vendor/current/Doc/includes/sqlite3/execute_1.py

    r2 r388  
    11import sqlite3
    22
    3 con = sqlite3.connect("mydb")
    4 
     3con = sqlite3.connect(":memory:")
    54cur = con.cursor()
     5cur.execute("create table people (name_last, age)")
    66
    77who = "Yeltsin"
    88age = 72
    99
    10 cur.execute("select name_last, age from people where name_last=? and age=?", (who, age))
     10# This is the qmark style:
     11cur.execute("insert into people values (?, ?)", (who, age))
     12
     13# And this is the named style:
     14cur.execute("select * from people where name_last=:who and age=:age", {"who": who, "age": age})
     15
    1116print cur.fetchone()
  • python/vendor/current/Doc/includes/sqlite3/executemany_2.py

    r2 r388  
    11import sqlite3
     2import string
    23
    34def char_generator():
    4     import string
    5     for c in string.letters[:26]:
     5    for c in string.lowercase:
    66        yield (c,)
    77
  • python/vendor/current/Doc/includes/sqlite3/rowclass.py

    r2 r388  
    11import sqlite3
    22
    3 con = sqlite3.connect("mydb")
     3con = sqlite3.connect(":memory:")
    44con.row_factory = sqlite3.Row
    55
    66cur = con.cursor()
    7 cur.execute("select name_last, age from people")
     7cur.execute("select 'John' as name, 42 as age")
    88for row in cur:
    9     assert row[0] == row["name_last"]
    10     assert row["name_last"] == row["nAmE_lAsT"]
     9    assert row[0] == row["name"]
     10    assert row["name"] == row["nAmE"]
    1111    assert row[1] == row["age"]
    1212    assert row[1] == row["AgE"]
  • python/vendor/current/Doc/includes/sqlite3/shared_cache.py

    r2 r388  
    22
    33# The shared cache is only available in SQLite versions 3.3.3 or later
    4 # See the SQLite documentaton for details.
     4# See the SQLite documentation for details.
    55
    66sqlite3.enable_shared_cache(True)
  • python/vendor/current/Doc/includes/sqlite3/shortcut_methods.py

    r2 r388  
    1818    print row
    1919
    20 # Using a dummy WHERE clause to not let SQLite take the shortcut table deletes.
    21 print "I just deleted", con.execute("delete from person where 1=1").rowcount, "rows"
     20print "I just deleted", con.execute("delete from person").rowcount, "rows"
  • python/vendor/current/Doc/includes/sqlite3/text_factory.py

    r2 r388  
    33con = sqlite3.connect(":memory:")
    44cur = con.cursor()
    5 
    6 # Create the table
    7 con.execute("create table person(lastname, firstname)")
    85
    96AUSTRIA = u"\xd6sterreich"
     
    1815cur.execute("select ?", (AUSTRIA,))
    1916row = cur.fetchone()
    20 assert type(row[0]) == str
     17assert type(row[0]) is str
    2118# the bytestrings will be encoded in UTF-8, unless you stored garbage in the
    2219# database ...
     
    3027                         u"\xe4\xf6\xfc".encode("latin1"),))
    3128row = cur.fetchone()
    32 assert type(row[0]) == unicode
     29assert type(row[0]) is unicode
    3330
    3431# sqlite3 offers a built-in optimized text_factory that will return bytestring
     
    3734cur.execute("select ?", (AUSTRIA,))
    3835row = cur.fetchone()
    39 assert type(row[0]) == unicode
     36assert type(row[0]) is unicode
    4037
    4138cur.execute("select ?", ("Germany",))
    4239row = cur.fetchone()
    43 assert type(row[0]) == str
     40assert type(row[0]) is str
  • python/vendor/current/Doc/includes/tzinfo-examples.py

    r2 r388  
    7272        tt = (dt.year, dt.month, dt.day,
    7373              dt.hour, dt.minute, dt.second,
    74               dt.weekday(), 0, -1)
     74              dt.weekday(), 0, 0)
    7575        stamp = _time.mktime(tt)
    7676        tt = _time.localtime(stamp)
Note: See TracChangeset for help on using the changeset viewer.