Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Space Kablooey
May 6, 2009


Boris Galerkin posted:

Yes, doxygen lets me do this. For example in fortran syntax, I can do normal comments that won't show up in the auto generated documentation with the normal '!' prefix, but I can also choose to use '!<' and doxygen will include that particular comment line. For my second example, standard fortran doesn't really have dicts so you could use something like a derived type or whatever.

code:

type :: parameters
     int :: a_flag !> info about this flag
     int :: a_different_flag !> info about this one

     ! this is a regular comment like that doxygen will ignore

end type parameters

And in the documentation it automagically documents each member "key" without me having to copy and paste it and put it all into a docstring.

I meant any projects that were generated with Sphinx

Adbot
ADBOT LOVES YOU

Space Kablooey
May 6, 2009


Dictionaries keep their keys as hashes, so accessing different sets shouldn't be too bad, and iterating through sets should also be fast enough.

However, that architecture seems a bit strange to me. Why can't you keep a list of visible entities on each instance instead of having this Visibility class? Presumably, you are already holding a collection of players instances and entities instances around, and having this visibility data separate from the main instances can only hurt you in the long run.

Space Kablooey
May 6, 2009


_ is less garbage to read than unused.

Space Kablooey
May 6, 2009


Thermopyle posted:

I came across the plumbum library that's pretty neat for easing this type of work.

I mean, gently caress bash and that's a really sexy API, but I feel like this is just hiding the bash under a Python rug and calling it a day.

Space Kablooey
May 6, 2009


fletcher posted:

I think this is more of a Python question than a Django question...

I'm using django-after-response to invoke a long method after a request completes. I want to log that long running method in a separate file (as well as to the normal application log) so I do the following:
code:
                temp_deploy_log = NamedTemporaryFile()
                formatter = logging.Formatter("%(asctime)-15s %(levelname)-8s %(message)s")
                deploy_log_handler = logging.FileHandler(deployment.log.path)
                deploy_log_handler.setFormatter(formatter)
                deploy_log_handler.setLevel(logging.INFO)
                logging.getLogger('').addHandler(deploy_log_handler)
The problem I'm running into is that temp_deploy_log ends up having log entries from multiple threads if they are running concurrently. How do I prevent this from happening? I'm using uWSGI if that makes a difference.

Just spitballing here, but try to give the NamedTemporaryFile an unique prefix and/or suffix? Also, you might want to give it delete=False.

Adbot
ADBOT LOVES YOU

Space Kablooey
May 6, 2009


is the new thread going to be backwards compatible with this thread?

  • Locked thread