There's around 30 objects that would have to be "mockified" that way, i think MPE's app.py would be more suited to hacking tho - it is smaller, but i could really do with some help with this.. i found out i'm not much of a python person, it's syntax seems like someone crossed C++ with perl and turned on strict identitation in pawn compiler :S
I think those are the same.
But the mock I propose can be fitted anywhere.
Part of the mock would be this (from memory, so not complete):
class Mock:
def __init__(self, name):
self.__name = name
def __call__(self, *args, **kwargs):
return Mock("%s(%s, %s)"%(self.__name, str(args), str(kwargs)))
def __getattr__(self, name):
return Mock("%s::%s" % (self.__name, name))
def __str__(self):
return "Mock(%s)"%self.__name
def __repr__(self):
return self.__str__()
Then, before you import App you do this:
import sys
sys.modules["Appc"] = Mock("Appc")
Oddly enough, perhaps, I think Pythons syntax is hardly anything like C++ or Perl (and I've programmed in both).
And I find the "indendation is scoping" quite readable. You have to agree that the mess people can make if you don't enforce indendation can be a crime, assuming you are working with more than 1 person at the same time, or if other people than yourself need to read the code.
The idea for the mock is to load up the hardpoint, then, assuming you print out everything, you can parse the result in some more friendly format.
[EDIT]
So you get something like this as output:
App::HullProperty_Create
App::HullProperty_Create("Hull")
App::HullProperty_Create("Hull")::SetMaxCondition
App::HullProperty_Create("Hull")::SetMaxCondition(9000.0)
.......
Ok, so only printing on __call__ would suffice I think.
