Mailing List Archive

Account Manager 0.6.dev0 not updating?
I'm trying to install Account Manager 0.6.dev0 on Ubuntu 18.04LTS with Trac
1.4.2. It installed properly (sudo -H pip install --pre TracAccountManager)
and comes up in Trac, but Notifications don't work. Notifications are set
to I get the following error:

2021-04-15 13:40:37,744 Trac[api] INFO: Email verification requested for
user: username
2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor caught
exception while formatting account to text/plain for email: <class
'acct_mgr.notification.AccountNotificationFormatter'>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/trac/notification/mail.py",
line 487, in distribute
outputs[fmt] = formatter.format(transport, fmt, event)
File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
line 171, in format
return self._format_body(data, template_name)
File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
line 179, in _format_body
template = chrome.load_template(template_name, method='text')
TypeError: load_template() got an unexpected keyword argument 'method'
2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor cannot send
event 'account' as 'text/plain': username@domain.com

[notification]
admit_domains =
ambiguous_char_width = single
batch_subject_template = ${prefix} Batch modify: ${tickets_descr}
default_format.email = text/html
email_address_resolvers = SessionEmailResolver
email_sender = SendmailEmailSender
ignore_domains =
message_id_hash = md5
mime_encoding = none
sendmail_path = /usr/sbin/ssmtp
smtp_always_bcc =
smtp_always_cc =
smtp_default_domain =
smtp_enabled = enabled

It was my understanding this error was fixed in 0.6.dev0 according to Changeset
17831 <https://trac-hacks.org/changeset/17831> but the lines in
/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py do not
reflect the change shown in that Changeset.

def _format_body(self, data, template_name):
# 3 commented lines are replacements for when Trac < 1.4 is dropped
chrome = Chrome(self.env)
data = chrome.populate_data(None, data)
template = chrome.load_template(template_name, method='text')
#template = chrome.load_template(template_name, text=True)
t = deactivate() # don't translate the e-mail stream
try:
stream = template.generate(**data)
return stream.render('text', encoding='utf-8')
#body = chrome.render_template_string(template, data, text=True)
#return body.encode('utf-8')
except Exception as e:
self.log.error("Failed to format body of notification mail: %s",
exception_to_unicode(e, traceback=True))
finally:
reactivate(t)

So, I tried uninstalling 0.6.dev0 and downloading the wheel from
https://pypi.org/project/TracAccountManager/0.6.dev0/#modal-close and
installing from that using
sudo -H python -m pip install TracAccountManager-0.6.dev0-py2-none-any.whl
I used sudo so it would install in the python2.7/dist-packages directory,
however, it still shows the old lines in notifications.py.
What am I missing?

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/96eda815-343b-4c6f-aa5c-7016d0010b22n%40googlegroups.com.
Re: Account Manager 0.6.dev0 not updating? [ In reply to ]
On Thursday, April 15, 2021 at 10:54:08 AM UTC-7 steel...@raidoh.com wrote:

> I'm trying to install Account Manager 0.6.dev0 on Ubuntu 18.04LTS with
> Trac 1.4.2. It installed properly (sudo -H pip install --pre
> TracAccountManager) and comes up in Trac, but Notifications don't work.
> Notifications are set to I get the following error:
>
> 2021-04-15 13:40:37,744 Trac[api] INFO: Email verification requested for
> user: username
> 2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor caught
> exception while formatting account to text/plain for email: <class
> 'acct_mgr.notification.AccountNotificationFormatter'>
> Traceback (most recent call last):
> File "/usr/local/lib/python2.7/dist-packages/trac/notification/mail.py",
> line 487, in distribute
> outputs[fmt] = formatter.format(transport, fmt, event)
> File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
> line 171, in format
> return self._format_body(data, template_name)
> File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
> line 179, in _format_body
> template = chrome.load_template(template_name, method='text')
> TypeError: load_template() got an unexpected keyword argument 'method'
> 2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor cannot send
> event 'account' as 'text/plain': user...@domain.com
>
> [notification]
> admit_domains =
> ambiguous_char_width = single
> batch_subject_template = ${prefix} Batch modify: ${tickets_descr}
> default_format.email = text/html
> email_address_resolvers = SessionEmailResolver
> email_sender = SendmailEmailSender
> ignore_domains =
> message_id_hash = md5
> mime_encoding = none
> sendmail_path = /usr/sbin/ssmtp
> smtp_always_bcc =
> smtp_always_cc =
> smtp_default_domain =
> smtp_enabled = enabled
>
> It was my understanding this error was fixed in 0.6.dev0 according to Changeset
> 17831 <https://trac-hacks.org/changeset/17831> but the lines in
> /usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py do not
> reflect the change shown in that Changeset.
>
> def _format_body(self, data, template_name):
> # 3 commented lines are replacements for when Trac < 1.4 is dropped
> chrome = Chrome(self.env)
> data = chrome.populate_data(None, data)
> template = chrome.load_template(template_name, method='text')
> #template = chrome.load_template(template_name, text=True)
> t = deactivate() # don't translate the e-mail stream
> try:
> stream = template.generate(**data)
> return stream.render('text', encoding='utf-8')
> #body = chrome.render_template_string(template, data,
> text=True)
> #return body.encode('utf-8')
> except Exception as e:
> self.log.error("Failed to format body of notification mail:
> %s",
> exception_to_unicode(e, traceback=True))
> finally:
> reactivate(t)
>
> So, I tried uninstalling 0.6.dev0 and downloading the wheel from
> https://pypi.org/project/TracAccountManager/0.6.dev0/#modal-close and
> installing from that using
> sudo -H python -m pip install TracAccountManager-0.6.dev0-py2-none-any.whl
> I used sudo so it would install in the python2.7/dist-packages directory,
> however, it still shows the old lines in notifications.py.
> What am I missing?
>

I don't recall where we are at with the TracAccountManager compatibility.
I'd try installing from trunk:

pip uninstall TracAccountManager
pip install svn+https://trac-hacks.org/svn/accountmanagerplugin/trunk

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/bff1f9e3-00c3-453e-ab93-eeb21a896ab4n%40googlegroups.com.
Re: Account Manager 0.6.dev0 not updating? [ In reply to ]
Perfect. This plus installing TracAnnouncer worked. I thought it was an
optional plugin but it appears to be required for AccountManager
notifications.

On Thursday, April 15, 2021 at 6:22:37 PM UTC-4 RjOllos wrote:

> On Thursday, April 15, 2021 at 10:54:08 AM UTC-7 steel...@raidoh.com
> wrote:
>
>> I'm trying to install Account Manager 0.6.dev0 on Ubuntu 18.04LTS with
>> Trac 1.4.2. It installed properly (sudo -H pip install --pre
>> TracAccountManager) and comes up in Trac, but Notifications don't work.
>> Notifications are set to I get the following error:
>>
>> 2021-04-15 13:40:37,744 Trac[api] INFO: Email verification requested for
>> user: username
>> 2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor caught
>> exception while formatting account to text/plain for email: <class
>> 'acct_mgr.notification.AccountNotificationFormatter'>
>> Traceback (most recent call last):
>> File
>> "/usr/local/lib/python2.7/dist-packages/trac/notification/mail.py", line
>> 487, in distribute
>> outputs[fmt] = formatter.format(transport, fmt, event)
>> File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
>> line 171, in format
>> return self._format_body(data, template_name)
>> File "/usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py",
>> line 179, in _format_body
>> template = chrome.load_template(template_name, method='text')
>> TypeError: load_template() got an unexpected keyword argument 'method'
>> 2021-04-15 13:40:37,749 Trac[mail] WARNING: EmailDistributor cannot send
>> event 'account' as 'text/plain': user...@domain.com
>>
>> [notification]
>> admit_domains =
>> ambiguous_char_width = single
>> batch_subject_template = ${prefix} Batch modify: ${tickets_descr}
>> default_format.email = text/html
>> email_address_resolvers = SessionEmailResolver
>> email_sender = SendmailEmailSender
>> ignore_domains =
>> message_id_hash = md5
>> mime_encoding = none
>> sendmail_path = /usr/sbin/ssmtp
>> smtp_always_bcc =
>> smtp_always_cc =
>> smtp_default_domain =
>> smtp_enabled = enabled
>>
>> It was my understanding this error was fixed in 0.6.dev0 according to Changeset
>> 17831 <https://trac-hacks.org/changeset/17831> but the lines in
>> /usr/local/lib/python2.7/dist-packages/acct_mgr/notification.py do not
>> reflect the change shown in that Changeset.
>>
>> def _format_body(self, data, template_name):
>> # 3 commented lines are replacements for when Trac < 1.4 is
>> dropped
>> chrome = Chrome(self.env)
>> data = chrome.populate_data(None, data)
>> template = chrome.load_template(template_name, method='text')
>> #template = chrome.load_template(template_name, text=True)
>> t = deactivate() # don't translate the e-mail stream
>> try:
>> stream = template.generate(**data)
>> return stream.render('text', encoding='utf-8')
>> #body = chrome.render_template_string(template, data,
>> text=True)
>> #return body.encode('utf-8')
>> except Exception as e:
>> self.log.error("Failed to format body of notification mail:
>> %s",
>> exception_to_unicode(e, traceback=True))
>> finally:
>> reactivate(t)
>>
>> So, I tried uninstalling 0.6.dev0 and downloading the wheel from
>> https://pypi.org/project/TracAccountManager/0.6.dev0/#modal-close and
>> installing from that using
>> sudo -H python -m pip install TracAccountManager-0.6.dev0-py2-none-any.whl
>> I used sudo so it would install in the python2.7/dist-packages directory,
>> however, it still shows the old lines in notifications.py.
>> What am I missing?
>>
>
> I don't recall where we are at with the TracAccountManager compatibility.
> I'd try installing from trunk:
>
> pip uninstall TracAccountManager
> pip install svn+https://trac-hacks.org/svn/accountmanagerplugin/trunk
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/0436b8dc-9e11-49a6-a08b-6a5b288e7be1n%40googlegroups.com.
Re: Account Manager 0.6.dev0 not updating? [ In reply to ]
On Friday, April 16, 2021 at 11:16:28 AM UTC-7 steel...@raidoh.com wrote:

> Perfect. This plus installing TracAnnouncer worked. I thought it was an
> optional plugin but it appears to be required for AccountManager
> notifications.
>

This may be a case of: if it works don't try to fix it. But to give some
context, TracAnnouncer was deprecated in release 1.2 when a similar design
was implemented in Trac. The TracAnnouncer component shouldn't be required,
but I'm not sure how far we got with porting the TracAccountManager code to
the new notification system.
https://trac.edgewall.org/wiki/TracChangeLog#a1.2Hermes

Ryan

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/74f16b26-0eef-451b-9c45-67486d21da95n%40googlegroups.com.