Search the web
Sign In
New User? Sign Up
quark-python · QuArK Python Tech Info
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
New tagging API :: quarkpy.tagging   Message List  
Reply | Forward Message #6960 of 6984 |

Hi folks,

I've just committed a new file to the repository:

quarkpy/tagging.py

This module provides a new API for tagging objects. Feel free to
check it out, and use it. It's fully documented, with docstrings! :)

Basically, this is designed to help plugin authors avoid stomping all
over each others tags, and also to do things slightly more
Pythonically than the existing API. Also, since some code in quarkpy
was using the current API, it seemed like a good idea to move tagging
code into the quarkpy module (quarkpy is meant to be independent of
plugins)!

Tags are stored by category, and each category is specified by a
'key'.

You can get all the tags in a category using gettaglist(). You can
get the most recently tagged object in a category using
getuniquetag(). If you want to only ever have one object in your
category tagged, use uniquetag() and cleartags(). If you want to
allow more than one object to be tagged, use tag(), untag() and
cleartags(). Read the docstrings, it all makes sense really.

You can get the editor to draw tags by setting a drawing function for
a particular category.

The current tagging code is a disaster area, and I decided to put
things as mundane as toolbar editing on hold until it was under
control. I need to get this API pinned down before I start cleaning
up the plugins, so what I need to know right now is:

Should I require a key to be specified for all of the tagging
functions?

'Yes' will make it harder for plugins to unwittingly mangle other
plugins' state, but might be considered too restrictive.

Your input greatly appreciated.

Peter :)


P.S. When coding with this module, DON'T TOUCH ANY FUNCTION OR
VARIABLE THAT BEGINS WITH AN UNDERSCORE! Or I will kill you. Yes.

The way the module's written at the moment, I can easily change the
way it works completely without changing the API. I'd like to keep it
that way.

--
Quake II build tools: http://peter-b.co.uk/
Latest QuArK: http://quark.sourceforge.net/LatestVersion

v2sw6YShw7ln5pr6ck3ma8u7Lw3+2m0l7CFi6e4+8t4Eb8Aen4g6Pa2Xs5MSr5p4
hackerkey.com




Sun Sep 18, 2005 11:23 pm

BRETTP98
Offline Offline
Send Email Send Email

Forward
Message #6960 of 6984 |
Expand Messages Author Sort by Date

Hi folks, I've just committed a new file to the repository: quarkpy/tagging.py This module provides a new API for tagging objects. Feel free to check it out,...
Peter TB Brett
BRETTP98
Offline Send Email
Sep 18, 2005
11:23 pm

... A quick note: the drawing functions won't actually work until I've changed the current tagging module to emulate the current functionality using the new...
Peter TB Brett
BRETTP98
Offline Send Email
Sep 19, 2005
6:26 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help