[Users] Python Plugin Information/Help
Peter Hanlon
hanlonpp at tpg.com.au
Thu Mar 19 04:49:01 CET 2020
The python structure that I have been using to run various mail
functions is as follows:-
# -*- coding: utf-8 -*
#
import os
import datetime
def doAutoActions():
actlist = [
"Message/Receive/CurrentAccount",
"File/Exit"]
action_group = clawsmail.get_mainwindow_action_group()
for act in actlist:
action1 = action_group.get_action(act)
print("activating " + act)
action1.activate()
print("completed " + act)
return
print("debug initiated")
doAutoActions()
print ("debug complete")
If I run this as a manual operation from the Tools/Python Scripts
menu,Claws-Mail closes down cleanly.
If I run it or any elaboration of it as a call from the auto/startup
script, everything happens except File/Exit appears to be ignored.
Peter
On Wed, 18 Mar 2020 13:51:33 +1100
Peter Hanlon <hanlonpp at tpg.com.au> wrote:
> I have been trying to run an automated claws-mail application, very
> dependent upon the brilliant Python plugin. The general notion is
> that I would run a series of mail activities driven off the
> auto/startup module, predominantly upon the Inbox, which in turn
> might generate outbound emails, and their delivery, and a final clean
> shutdown, and subsequent restart via crontab.
>
> The activities include mail tasks such as File/EmptyTrashes,
> File/Exit and various more complex procedures which are invoked from
> Python main/mymodule1,mymodule2 etc.
>
> I am using Raspberry Pi, Claws-Mail 3.17.3-2.
>
> I have had two major problems, starting up, and shutting down.
>
> The first is attempting to run claws-mail from a crontab entry, which
> would cause it to in turn invoke Holger’s Python ’startup’ module. I
> played about with lxterminal, xterm, and God knows what else.
>
> A very cryptic crontab entry '*/10 * * * * DISPLAY=:0 claws-mail
> —receive-all’ sorted that out, and I can now automatically invoke
> claws-mail, do whatever with the mail queues, present stuff for
> output mail delivery, except
>
> When I finally run a ‘File/Exit’ command, it appears to process the
> command but ignores it. Hitting the X terminator at the right top of
> the window does the job, but not automated.
>
> I have looked through the various config options for possible
> blocking popups (Do you really want to Empty Trash etc), but can’t
> find anything which seems relevant.
>
> I could run a further crontab to kill my running claws-mail in
> advance of the startup one, but think I should be able to manage a
> graceful exit.
>
> Are there any return codes/logs etc that might help me pin point the
> problem?
>
> Peter Hanlon
>
> >
> _______________________________________________
> Users mailing list
> Users at lists.claws-mail.org
> https://lists.claws-mail.org/cgi-bin/mailman/listinfo/users
More information about the Users
mailing list