| 1 |
import psycopg2 |
| 2 |
from datetime import date, datetime |
| 3 |
from trac.util.datefmt import to_timestamp, utc |
| 4 |
|
| 5 |
def add_ticket(self, dbinfo, summary, desc) : |
| 6 |
conn = psycopg2.connect(dbinfo) |
| 7 |
curs = conn.cursor() |
| 8 |
created = to_timestamp(datetime.now(utc)) |
| 9 |
curs.execute("INSERT INTO ticket \ |
| 10 |
(type,time,changetime,component,priority,owner,reporter,cc,version,milestone,status,summary,description, keywords) \ |
| 11 |
VALUES \ |
| 12 |
('defect', %s, %s, 'other','major','somebody','Coccinelle','','next','','new','%s','%s', '')" % (created, created, summary, desc) ) |
| 13 |
conn.commit() |