Page 1 of 1

k2tools - General purpose library package [WIP] [SVN]

Posted: Tue Nov 20, 2012 3:56 pm
by Omega_K2
k2tools - General purpose library package

Quicklinks

Documentation | SVN Repository | Bug Report Forum | Suggestion Forum

Overview

This is a package of several different general purpose libaries. I deceided to make them public in one large release, as I'll be using many of these in my other scripts, and this makes it easier to keep them update and you'll always have everything you need without extra hassle.
You are welcome to use these in your own scripts too, however, all these libaries are subject to change, so the API may not stay the same thoughout the versions. Especially the misc.py may change rather often.

If you find bugs or have any ideas let me know, and I'll think about including them.

This is what is currently included with k2tools:

auth
Subpackage - more advanced alternative to Source.Python authentification

popup
Subpackage - popups

cmdlib.py
Advanced command library providing many additional featues (also see here)

config.py
Some utility functions to make loading/verifying configobj configs easier

colormsg.py
Support for using ES-style tags to add color to messages

data.py
Some general data variables and functions, such as server ip and current map

keyvalues.py
Parser for Valve's KeyValues format (No SP required!)

langlib.py
Remake of Eventscripts' langlib.py to keep compability of languages files

misc.py
Functions and classes that did not fit into another library

pubcvarlib.py
Small library to mainstream adding public variables (+ resetting of version values) (Port of my Eventscripts pubcvarlib)

smauth.py
Providing sourcemod authentification for the admin flatfiles (no SQL support) (Port of my Eventscripts smauth)

strings.py
Provides some gernal purpose methods for working with strings, such as fill functions. Also has some hug thing.

threadlib.py
Utility methods/classes for threading in SourcePython

threaddb.py
Threaded execution that works with gameservers for DPAPI 2.0 modules. Currently pymysql is supported (auto-reconnect) & tested


Documentation

You can view the documentation here:

https://www.german-slaughterhouse.de/wiki/K2Tools:K2Tools

I'll update this occassionally, but it won't be up-to-date all the time. Refer to the files for the most recent documentation.


Public SVN

All versions can be found at:
https://svn.german-slaughterhouse.de/svn/k2tools/

I'm using a self-singed certificate, so if you open this in your browser, it will bitch about it. You'll have to add an exception if you want to view it online.

See below to find out what package to use.


Latest development version

This version is always the most update, but is not necessarily tested for bug or even working at all. At times I may commit untested, nonworking changes or unfished stuff here

https://svn.german-slaughterhouse.de/svn/k2tools/trunk/

You can also find a revision of the trunk attached to this post:
soon to be added

Latest stable version (coming soon)

This version is usually a release-version, but may also be updated outside of releases. This is generally safe to use.

https://svn.german-slaughterhouse.de/svn...braches/stable


Releases

Releases will put be put here with their accoding version number. These packages are highly unlikely to change.

https://svn.german-slaughterhouse.de/svn/k2tools/tags/<release>


Known Issues

Please always check the header of the files and lines with TODO, generally known issues or missing features.

Despite that:
  • misc.py - TeamColor doesn't really work (as there is no \x07RRGGBB format)

Posted: Tue Nov 20, 2012 3:57 pm
by Omega_K2
Reversed for future use.

Posted: Tue Nov 20, 2012 3:57 pm
by Omega_K2
Downloads

Development Versions

The attachment k2tools_trunk_r35.zip is no longer available

Posted: Sun Jul 14, 2013 8:23 pm
by Omega_K2
No idea whether anyone is using this at this point, but I feel like I should note that I've updated a few things (rev 10 to 16):

  • Everything should work with the new SP build now, note that some stuff is still missing in SP (like INetInfo interface or w/e it's called.. network address validation won't work with smauth)
  • mysqlllib replaced by threaddb
  • All methods were changed from CamelCase to underscore_style to match the rewrite of SP and PEP8
  • I added a new libary colormsg.py that can be used to send color messages with tags in them (es style like... #greenThis is green#redThis is red)

You can read full changelog in the SVN if you view the logs (either online or otherwise).

Posted: Tue Aug 06, 2013 10:28 pm
by satoon101
You really shouldn't be using the _libs folder for this. The proper place for 3rd party packages is in the _engines/site-packages/ directory. Only SP's built-in packages should be in the _libs directory.

Satoon

Posted: Wed Aug 07, 2013 12:36 am
by Omega_K2
satoon101 wrote:You really shouldn't be using the _libs folder for this. The proper place for 3rd party packages is in the _engines/site-packages/ directory. Only SP's built-in packages should be in the _libs directory.

Satoon


I always felt the site-packages directory is better suited for gerneral-purpose python packages. I wouldn't want people under the impression this works outside of source-python. Simiarly, this doesn't require to be loaded in a traditional sense, so normal plugin-folder might work, but is imho a nogo too. How about a custom lib folder for sp-specific libaries? (like _customlibs oder _userlibs - or think about SM, they also kinda allow stock plugins/extensions in the same)

If you really want I can just move it in the next rev anyway, it's just a matter of search and replace anway

Posted: Wed Aug 07, 2013 2:06 am
by satoon101
I will think about a custom lib folder. That sounds like an interesting idea worth considering. I will let you know.

Thanks,
Satoon

Posted: Thu Sep 12, 2013 3:04 pm
by Omega_K2
Updated for latest SP, untested though =P

Use Rev <25 for the HG Source.Python and latest for the latest GIT Source.Python.

I'll attach a zip from the SVN later when I tested some things :P

Posted: Sun Sep 29, 2013 3:24 am
by Omega_K2
I've added a popup library to k2tools, which supports rather complex creation of popups.

See the wiki page or script files for more info:

https://svn.german-slaughterhouse.de/svn/k2tools/trunk/addons/source-python/packages/custom/k2tools/popup/
https://www.german-slaughterhouse.de/wiki/K2Tools:Popup

Posted: Sun Feb 09, 2014 9:19 pm
by Omega_K2
Updated for latest revision of Source Python (development), use Rev 40 or the zip I attached to the original post.