Funny problem: I need to extract data from working instance

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Funny problem: I need to extract data from working instance

Serge Z
Heya everyone

I have a simple py-script with variable sessions  inside. This var stores objects different data about current users for internal use.

sessions = {} # dictionary of objects
class Sess:
  uptime = 0
  visits_freq = 0

Now I need some statisc data from this variable but I dunt know how to read it.

Any ideas please? 

Serge

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Funny problem: I need to extract data from working instance

Michiel Overtoom

Hi Serge,

> On 2017-02-19, at 17:32, Serge Z <[hidden email]> wrote:
>
> I have a simple py-script with variable sessions  inside. This var stores objects different data about current users for internal use.
>
> Any ideas please?

In a program I once wrote, I printed all active sessions with:

    a = cherrypy.serving.session.cache # dict. Mapping from session-id -> tuple(data dict, last time)

    for k, v in a.iteritems():
        print "%s -> %r" % (k, v)

Greetings,


--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
Loading...