[Trac] Mercurial plugin error: TypeError: __init__() got an unexpected keyword argument 'interactive'

2009-07-05 Thread andref.d...@gmail.com

I've got this message error when I tried to create or access any Trac
project based on a Mercurial repository:

TypeError: __init__() got an unexpected keyword argument 'interactive'

Python Traceback
Most recent call last:

* File /usr/local/lib/python2.6/dist-packages/Trac-0.11.5rc1-
py2.6.egg/trac/web/main.py, line 444, in _dispatch_request
  Code fragment:
   439. try:
   440. if not env and env_error:
   441. raise HTTPInternalError(env_error)
   442. try:
   443. dispatcher = RequestDispatcher(env)
   444. dispatcher.dispatch(req)
   445. except RequestDone:
   446. pass
   447. resp = req._response or []
   448.
   449. except HTTPException, e:
  Local variables:
  Name  Value
  after [u' except RequestDone:', u' pass', u' resp = ...
  before[u' try:', u' if not env and env_error:', u' raise ...
  dispatchertrac.web.main.RequestDispatcher object at
0x7f95979ceed0
  e TypeError(__init__() got an unexpected keyword argument
'interactive',)
  env   trac.env.Environment object at 0x7f95972c9110
  env_error None
  exc_info  (type 'exceptions.TypeError', TypeError(__init__()
got an unexpected ...
  filename  '/usr/local/lib/python2.6/dist-packages/Trac-0.11.5rc1-
py2.6.egg/trac/web/m ...
  frames[{'function': '_dispatch_request', 'lines_before': [u'
try:', u' ...
  has_admin True
  line  u' dispatcher.dispatch(req)'
  lineno443
  message   uTypeError: __init__() got an unexpected keyword
argument 'interactive'
  req   Request GET u'/'
  resp  []
  tbtraceback object at 0x7f9597be52d8
  tb_hide   None
  traceback u'Traceback (most recent call last):\n File ...
* File /usr/local/lib/python2.6/dist-packages/Trac-0.11.5rc1-
py2.6.egg/trac/web/main.py, line 175, in dispatch
  Code fragment:
   170. if not req.path_info or req.path_info == '/':
   171. chosen_handler = self.default_handler
   172. # pre-process any incoming request, whether a handler
   173. # was found or not
   174. chosen_handler = self._pre_process_request(req,
   175. chosen_handler)
   176. except TracError, e:
   177. raise HTTPInternalError(e)
   178. if not chosen_handler:
   179. if req.path_info.endswith('/'):
   180. # Strip trailing / and redirect
  Local variables:
  Name  Value
  chosen_handlertrac.wiki.web_ui.WikiModule object at
0x7f95979f1410
  chrometrac.web.chrome.Chrome object at 0x7f959782dd50
  err   (type 'exceptions.TypeError', TypeError(__init__() got
an unexpected ...
  handler   trac.prefs.web_ui.PreferencesModule object at
0x7f95979f14d0
  req   Request GET u'/'
  self  trac.web.main.RequestDispatcher object at 0x7f95979ceed0
* File /usr/local/lib/python2.6/dist-packages/Trac-0.11.5rc1-
py2.6.egg/trac/web/main.py, line 295, in _pre_process_request
  Code fragment:
   290. req.outcookie['trac_form_token']['secure'] = True
   291. return req.outcookie['trac_form_token'].value
   292.
   293. def _pre_process_request(self, req, chosen_handler):
   294. for filter_ in self.filters:
   295. chosen_handler = filter_.pre_process_request(req,
chosen_handler)
   296. return chosen_handler
   297.
   298. def _post_process_request(self, req, *args):
   299. nbargs = len(args)
   300. resp = args
  Local variables:
  Name  Value
  chosen_handlertrac.wiki.web_ui.WikiModule object at
0x7f95979f1410
  filter_   trac.versioncontrol.api.RepositoryManager object at
0x7f95979f1810
  req   Request GET u'/'
  self  trac.web.main.RequestDispatcher object at 0x7f95979ceed0
* File /usr/local/lib/python2.6/dist-packages/Trac-0.11.5rc1-
py2.6.egg/trac/versioncontrol/api.py, line 86, in pre_process_request
  Code fragment:
81.
82. def pre_process_request(self, req, handler):
83. from trac.web.chrome import Chrome, add_warning
84. if handler is not Chrome(self.env):
85. try:
86. self.get_repository(req.authname).sync()
87. except TracError, e:
88. add_warning(req, _(Can't synchronize with the repository

89. (%(error)s). Look in the Trac log for more 
90. information., error=to_unicode(e.message)))
91.
  Local variables:
  Name  Value
  Chromeclass 'trac.web.chrome.Chrome'
  add_warning   function add_warning at 0x7f9597294d70
  handler   trac.wiki.web_ui.WikiModule object at 0x7f95979f1410
  req   Request GET u'/'
  self  trac.versioncontrol.api.RepositoryManager object at
0x7f95979f1810
* File /usr/local/lib/python2.6/dist-packages/Trac-0.11.5rc1-
py2.6.egg/trac/versioncontrol/api.py, line 157, in get_repository
  Code fragment:
   152. repos = self._cache[tid]
   153. 

[Trac] Re: Trac VS Bugzilla

2009-07-05 Thread Eirik Schwenke
Иван Бессарабов skrev 02. juli 2009 08:42:
 I've had a task - every morning I needed to send list of task to the owners
 of that tikets.
 
 I've written the small script in perl language. The script is avaliable in
 my blog, but the blog is in russian language
 http://blog.bessarabov.ru/2008/07/23/send-active-trac-tickets-to-mail/
 
 I've placed that script into the crontab.
 
 Feel free to contact me on any questions about this script.
 

I made a minor change, and translated the comments to English (I hope, I
don't speak russian ;-). Just in case it's usefull for someone on this list.

I tested the script briefly, and it appears to work correctly.


Best regards,

-- 
 .---.  Eirik Schwenke eirik.schwe...@nsd.uib.no
( NSD ) Harald Hårfagresgate 29Rom 150
 '---'  N-5007 Bergentlf: (555) 889 13

  GPG-key at pgp.mit.edu  Id 0x8AA3392C
#! /usr/bin/perl
use strict;
use warnings;
use DBI;

# Cron script for sending regular reminders to ticket owner.
#
# Call from Cron, or Windows Scheduler.
#
# Original author: Иван Бессарабов
# Upstream version: http://blog.bessarabov.ru/2008/07/23/send-active-trac-tickets-to-mail/
#
# Simplisting translation to English and minor modifications by
# Eirik Schwenke eirik.schwe...@nsd.uib.no . Any errors in this version is not the fault of
# the original author.
#
# Help with transalation provided by http://babelfish.yahoo.com/

###
### Start - configuration settings
# Path to trac install:
my $trac = /var/trac/test;
# Ticket owner
my $owner = some_user;
# Email address where reminder is sent
my $email = some_us...@example.com;
### End - configuration settings
###

# Attempt to connect to trac database:
my $file = $trac . /db/trac.db;
my $dbh = DBI-connect(dbi:SQLite:dbname=$file,,, { RaiseError = 1, PrintError = 0 }) or
die Failed to connect to SQLite filesystem digest cache database at $file:  . DBI-errstr;
$dbh-{unicode} = 1;
# The query to be executed. This searches for all active tickets. 
my $sth = $dbh-prepare(
SELECT id, summary
 FROM ticket
 WHERE
  status IN ('new', 'assigned', 'reopened')
  AND owner = '$owner'
 ORDER BY id);
$sth-execute();

# Slurp all result into $content variable. 
my $content;
while (my $result = $sth-fetchrow_hashref) {
	$content .= # . $result-{id} .  - . $result-{summary} . \n;
}
# If the there is at least one ticket... 
if ($content) {
	# ... then we construct the message to be sent to owner:
	$content = All active tickets for user $owner\n\n . $content;
	# ... and attemt to send the email
  open(MAIL, |mail $email -s 'All active tickets for user $owner') or
die Cannot open mail: $!;
  binmode MAIL, :utf8;
  print MAIL $content;
  close(MAIL);
}
$sth-finish;


signature.asc
Description: OpenPGP digital signature