Logging from different python scripts to different output files

2017-03-27 Thread James McMahon
I'm struggling with Python logging. Have tried to apply several examples I
have found in the open source literature, but can't get it to work. What I
need to do is this: I have two python scripts, a.py and b.py. Each is
called by NiFi ExecuteScript processor repeatedly against many incoming
flowfiles. In every case I need to output log messages to two distinct and
different log files. My scripts run in the same Python interpreter, which
as i understand it means they rely on the same root level logger. I have
tried establishing non-root loggers for each, and associating distinct file
handles for each to those loggers.

My output still appears in multiple log files, and appears to be repeating
in increasing numbers each time I try a test run (first test, output line
appeared in log once. second test, twice. third test, three times, etc). Is
there an example that anyone knows of that demonstrates how two
concurrently running python scripts within the same interpreter can direct
output to two distinct log files? Thanks in advance for any help.
-- 
https://mail.python.org/mailman/listinfo/python-list


Check multiple file parms in single os.access?

2017-04-13 Thread James McMahon
Hello. Am a Python newbie. I have researched and found examples how we can
check existence, readability, and write-ability on a given fully-qualified
filename for the current python script user. Evidently os.access is the way
to go, wrapped in some additional try and catch logic that helps insulate
us from changes in file state after our os.access checks.

I understand that os.stat() calls can be relatively expensive. I assume
likewise for os.access(). Since I'm going to apply my Python permission
check script within a NiFi ExecuteScript processor handling many flowfiles,
I seek any and all performance optimizations I possibly can.

Is there a way to mask the F_OK, R_OK, and W_OK in a single os.access
call? I'm guessing there must be, rather than doing this

if ( os.access(fqfname,os.F_OK) and os.access(fqfname,os.R_OK) and
os.access(fqfname,os.W_OK)) :

Thanks in advance for your insights. -Jim
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Bigotry and hate speech on the python mailing list

2017-04-18 Thread James McMahon
Can the moderators please get involved here and remind people to address
python related topics and questions on the python mailing list? While I can
only speak to my interest when joining this list, isn't python why
most people joined this list? Others have different and polarizing views on
many subjects. This just isn't the right place to voice your views on
subjects other than python. I delete this same tired thread every day, and
every day it reappears. With all manners and due respect, stay on topic.

Isn't this list content moderated by anyone?

-Jim

On Mon, Apr 17, 2017 at 8:48 PM, Ethan Furman  wrote:

> On 04/17/2017 03:23 PM, Ben Finney wrote:
>
>> Paul Rubin writes:
>>
>>> Rurpy writes:
>>>
>>
> A couple weeks ago a frequent poster here (Steve D'Aprano)
 called another participant an "ugly american"

>>>
>>> Oh stop trolling.
>>>
>>
>> Paul, that is uncalled for. The charge of bigotry is not to be lightly
>> dismissed, and we do want to foster an environment here where people
>> will feel welcome.
>>
>
> You mean all the non-religious people?
>
> Because some of your signatures don't feel welcoming to people of faith:
>
>  \ “I think Western civilization is more enlightened precisely |
>   `\ because we have learned how to ignore our religious leaders.” |
> _o__)—Bill Maher, 2003 |
>
>  \   “Science shows that belief in God is not only obsolete. It is |
>   `\also incoherent.” —Victor J. Stenger, 2001 |
> _o__)  |
>
>  \   ?Give a man a fish, and you'll feed him for a day; give him a |
>   `\religion, and he'll starve to death while praying for a fish.? |
> _o__)   ?Anonymous |
>
>  \   ?Prayer must never be answered: if it is, it ceases to be |
>   `\   prayer and becomes correspondence.? ?Oscar Wilde, _The Epigrams |
> _o__)of Oscar Wilde_, 1952 |
>
> Steven, please try to be a little more attentive to people's delicate
>>> feefees in the future. Rurpy, should that take care of it?
>>>
>>
>> No, that doesn't do it. Taking care of people's feelings is an essential
>> part of keeping a community healthy and welcoming, and your belittling
>> does not help with that.
>>
>
> Neither do (a subset of) your signatures, yet you refuse to filter them
> out:
>
> [from previous email]
>
>> So I will continue to treat all those topics equally: peripheral
>> comments on beliefs are just part of respectful human discourse, so long
>> as I'm respectful of the people who may hold such beliefs.
>>
>
> So you're okay with respectfully making people of faith feel unwelcome?
>
> --
> ~Ethan~
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list