Re: [bottlepy/bottle] How to modify server adapters? (Issue #1385)

2022-06-27 Thread נתי שטרן
I looked on code but I still need help on this topic
I also need help with wsgiref

בתאריך יום שני, 27 ביוני 2022, מאת Marcel Hellkamp :

> Bottle is just a single file and server adapters are often just a couple
> of lines long. "Look at the code" is often the best advice. You so do not
> need server adapters to run a server. Bottle apps are WSGI apps. Just
> follow the documentation of the WSGI server you want to use.
>
> —
> Reply to this email directly, view it on GitHub
> ,
> or unsubscribe
> 
> .
> You are receiving this because you authored the thread.Message ID:
> 
>


-- 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Subtract n months from datetime

2022-06-27 Thread Peter J. Holzer
On 2022-06-21 05:29:52 +0100, Paulo da Silva wrote:
> I implemented a part of a script to subtract n months from datetime.
> Basically I subtracted n%12 from year and n//12 from the month adding 12
> months when it goes<=0. Then used try when converting to datetime again. So,
> if the day is for example 31 for a 30 days month it raises a ValuError
> exception. Then I subtract 1 to day and repeat.

For a recent longish discussion of that matter see the threads starting
at https://mail.python.org/pipermail/python-list/2022-April/905985.html
and https://mail.python.org/pipermail/python-list/2022-April/906045.html
(the latter also contains some prototype code).

(I apologize for not pursuing that further at the time. I wanted to
bolster that case with some real world applications, but I was a bit
swamped with Real Work™ and didn't find anything suitable.)

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-27 Thread Peter J. Holzer
On 2022-06-21 02:04:52 -0700, Chethan Kumar S wrote:
> I have a main process which makes use of different other modules. And
> these modules also use other modules. I need to log all the logs into
> single log file. Due to use of TimedRotatingFileHandler, my log
> behaves differently after midnight. I got to know why it is so but
> couldn't get how I can solve it.
> Issue was because of serialization in logging when multiple processes
 ^^
> are involved.

I think this is crucial point. Not "multiple modules" (as you wrote in
the subject), but "multiple processes". If each of multiple processes
wants to rotate the logfile itself, it is very likely that they will
work at cross-purposes.

Somebody already suggested using logrotate (or similar external tools).
You can then use WatchedFileHandler
(https://docs.python.org/3/library/logging.handlers.html#watchedfilehandler)
to automatically detect when a logile has been rotated.

Alternatively you can use a central logging service (like syslog) which
handles all that stuff.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Bottle server adepter - how to modify ?

2022-06-27 Thread נתי שטרן
Tnx

-- 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [bottlepy/bottle] How to modify server adapters? (Issue #1385)

2022-06-27 Thread נתי שטרן
I sent this to mailing list

בתאריך יום שני, 27 ביוני 2022, מאת Marcel Hellkamp :

> Then ask specific questions. Also, this is an issue tracker, not a support
> forum. Try the mailing-list.
>
> —
> Reply to this email directly, view it on GitHub
> ,
> or unsubscribe
> 
> .
> You are receiving this because you authored the thread.Message ID:
> 
>


-- 

-- 
https://mail.python.org/mailman/listinfo/python-list