Search found 542 matches

by BackRaw
Fri Aug 17, 2012 3:40 am
Forum: API Design
Topic: Coding Style
Replies: 42
Views: 191691

Again, this is for the API only. Use whatever you wish in your own scripts. I find separating the imports to be much easier to read. Also, OS explains that you are now starting the imports from the "os" module. You might find it ugly, but I find proper separation much more pleasing to the...
by BackRaw
Thu Aug 16, 2012 6:23 pm
Forum: API Design
Topic: Coding Style
Replies: 42
Views: 191691

Hhhmmm... I find these ones veeeeeeeeery ugly: # Python Imports # OS from os.path import dirname from os.path import join # Source.Python Imports ... Why not just leave it to that? # Python Imports from os.path import dirname from os.path import join # Source.Python Imports ... Looks easier to read ...
by BackRaw
Thu Aug 16, 2012 1:57 pm
Forum: API Design
Topic: Player List Filters
Replies: 20
Views: 20678

yeah, constants would be the best I think =)
by BackRaw
Tue Aug 14, 2012 1:04 pm
Forum: API Design
Topic: Player List Filters
Replies: 20
Views: 20678

How about the C++ variant? Like you open a file with[cpp]fstream fs; fs.open("filename", ios::out | ios::app | ios::binary); // I mean exactly this "|" ![/cpp]I saw this method in EventScripts playerlib I guess, I just can't remember where it was... So we could use # of course we...
by BackRaw
Sun Jul 22, 2012 7:30 pm
Forum: API Design
Topic: Using __call__ to execute a command on server/client
Replies: 8
Views: 9595

For your given example, this does not sound like a good idea to me at all. We would have to store all available commands for each type within Source.Python itself. This is definitely something we are not willing to do. Player functionality, like that of playerlib, is something that has not even got...
by BackRaw
Sun Jul 22, 2012 2:11 am
Forum: API Design
Topic: Configuration files
Replies: 4
Views: 6344

It will be a module that will utilize some of the same functionality of cfglib. If you look at GunGame51's cfg structure, you will likely see many of those design concepts integrated as well: http://code.google.com/p/gungame51/source/browse/#svn%2Ftrunk%2Fcstrike%2Faddons%2Feventscripts%2Fgungame51...
by BackRaw
Fri Jul 20, 2012 10:45 pm
Forum: API Design
Topic: Configuration files
Replies: 4
Views: 6344

Configuration files

Hello :D

Do we need to parse .cfg files for addon configuration? Is it worth a C++ library for it or should we stay with Python on this thing (like the ES cfglib)?
by BackRaw
Fri Jul 20, 2012 10:42 pm
Forum: Whatever
Topic: General Python question
Replies: 2
Views: 4318

your-name-here wrote:I am not sure. My guess is C++ will always be faster. Boost runs your code natively unlike a script which is run through the interpreter.


That's an argument! Thanks :)
by BackRaw
Fri Jul 20, 2012 10:07 pm
Forum: Whatever
Topic: General Python question
Replies: 2
Views: 4318

General Python question

Hi, is it faster to have a C++ code where you write boost.python mostly than to have Python code with the same? Like import os if __name__ == "__main__": x = [3, 6, 7, 9] z = os.getcwd() # do something else like reading a file and display its contents to the screen and #include <st...
by BackRaw
Fri Jul 20, 2012 4:47 pm
Forum: API Design
Topic: Event system discussion
Replies: 22
Views: 25959

Chrisber wrote:...and bad at the same time. This design speaks against the - more or less - strict typing of python. It is against its nature and that makes me think about to solve this.


Well, I meant that it's better than having a dict with pre-defined (string) variables...
by BackRaw
Thu Jul 19, 2012 7:19 pm
Forum: General Discussion
Topic: Admin System
Replies: 22
Views: 22824

If you want to support it, I'm all for that! The only reason why I pushed back on this is because I have my hands full maintaining SP leaving me no time for maintaining an admin system. I can imagine ;) Sure I wanna support it. Just take care of SP working 100% correctly, then we can move on with a...
by BackRaw
Thu Jul 19, 2012 12:51 pm
Forum: Module/Package Submissions
Topic: Auth API
Replies: 10
Views: 28292

I like those ideas very much. Go for it Satoon! :D
by BackRaw
Thu Jul 19, 2012 12:44 pm
Forum: API Design
Topic: Using __call__ to execute a command on server/client
Replies: 8
Views: 9595

We do not want to clutter up the sp.py, so more than likely "nothing" will need directly imported from sp itself. Once we get more of this functionality wrapped, we'll look into setting up the Python API for it. We are still in discussions about this, but it could also use a decorator, wh...
by BackRaw
Thu Jul 19, 2012 12:33 pm
Forum: Plugin Development Support
Topic: Error: _LoadedAddon has no attribute 'globals'
Replies: 21
Views: 20119

I actually encountered this error when trying to fix this issue: http://www.sourcepython.com/forums/showthread.php?43-Load-amp-Unload Though, it required that the error occurred in load and then I reload the addon. Yeah I tried to load and then reload it, of course. You might try the new build (jus...
by BackRaw
Wed Jul 18, 2012 10:54 pm
Forum: API Design
Topic: Using __call__ to execute a command on server/client
Replies: 8
Views: 9595

Why do you define kwargs? :) Also, you can simply add another parameter before *args, so you will get a more clearer error, if you don't pass anything. With these changes I come up with this: >>> class _Server(object): def __call__(self, command, *args): command = command + ' &#...
by BackRaw
Wed Jul 18, 2012 9:29 pm
Forum: API Design
Topic: Using __call__ to execute a command on server/client
Replies: 8
Views: 9595

Using __call__ to execute a command on server/client

How about something like that: # sp core module import sp_C # just a name for the C++ core, don't know what the name is, so let's assume it's sp_C class Server(sp_C.Server): def __call__(self, *args, **kwargs): # assuming args[0] is a command-string, like 'say "H...
by BackRaw
Wed Jul 18, 2012 9:15 pm
Forum: Plugin Development Support
Topic: Error: _LoadedAddon has no attribute 'globals'
Replies: 21
Views: 20119

satoon101 wrote:It does not make any sense...
Satoon


Yep, it definitely doesn't!
by BackRaw
Wed Jul 18, 2012 8:52 am
Forum: Plugin Development Support
Topic: Error: _LoadedAddon has no attribute 'globals'
Replies: 21
Views: 20119

You are importing a module that doesn't exist within source.python's search paths. Python then attempts to load your addon and bails out because the module decorators. Because it bails out mid-load, nothing is setup for the module. This is why you don't have a globals attribute. This is to be expec...
by BackRaw
Wed Jul 18, 2012 7:04 am
Forum: Plugin Development Support
Topic: Error: _LoadedAddon has no attribute 'globals'
Replies: 21
Views: 20119

I updated the source and compiled it again, but I forgot to copy over the addons directory...

Thanks for your help, it works now =)

+ the addon works now, too :D

EDIT: but, if I change the import to the wrong one (from events import decorators) on purpose, there's still the "globals" error =/
by BackRaw
Wed Jul 18, 2012 6:58 am
Forum: Plugin Development Support
Topic: Error: _LoadedAddon has no attribute 'globals'
Replies: 21
Views: 20119

I edited the post because the picture is so small^^ ⋅ msvcp100d.dll ⋅ msvcp100.dll ⋅ python33.dll ⋅ python33_d.dll ⋅ sqlite3.dll ⋅ sqlite3_d.dll Maybe renaming msvcp100d.dll to msvcp100_d.dll does the trick? EDIT: it doesn't. EDIT2: I'm con...

Go to advanced search