licable UUID and then invoke the method on
> it).
>
> That being the case, I think we should just keep the class methods.
>
> From: Will Stevens
> Sent: Sunday, May 1, 2016 12:15 PM
> To: dev@cloudstack.apache.org
> Subject: Re:
oke the method on
> it).
>
> That being the case, I think we should just keep the class methods.
>
> From: Will Stevens
> Sent: Sunday, May 1, 2016 12:15 PM
> To: dev@cloudstack.apache.org
> Subject: Re: Python Question (with regard
on it).
That being the case, I think we should just keep the class methods.
From: Will Stevens
Sent: Sunday, May 1, 2016 12:15 PM
To: dev@cloudstack.apache.org
Subject: Re: Python Question (with regards to Marvin)
Ya. Let's see how prevalent the class me
f I don't keep the class method.
>
> From: Will Stevens
> Sent: Sunday, May 1, 2016 12:03 PM
> To: dev@cloudstack.apache.org
> Subject: Re: Python Question (with regards to Marvin)
>
> It will be easy to grep if there class methods,
> From: Tutkowski, Mike
> Sent: Sunday, May 1, 2016 10:18 AM
> To: dev@cloudstack.apache.org
> Subject: Re: Python Question (with regards to Marvin)
>
> The question then becomes, do we want to keep the instance or the class
> method?
>
> There exists the same
e
> Sent: Sunday, May 1, 2016 10:18 AM
> To: dev@cloudstack.apache.org
> Subject: Re: Python Question (with regards to Marvin)
>
> The question then becomes, do we want to keep the instance or the class
> method?
>
> There exists the same problem for at least one other pai
ethod).
From: Tutkowski, Mike
Sent: Sunday, May 1, 2016 10:18 AM
To: dev@cloudstack.apache.org
Subject: Re: Python Question (with regards to Marvin)
The question then becomes, do we want to keep the instance or the class method?
There exists the same problem for at leas
:
>>print "class hi"
>>
>> # test = Test()
>>
>> Test.run()
>>
>> What gets printed:
>> class hi
>>
>> class Test:
>> def run(self):
>>print "instance hi"
>>
>>@classmethod
>
What gets printed:
> class hi
>
> class Test:
> def run(self):
> print "instance hi"
>
> @classmethod
> def run(cls):
> print "class hi"
>
> # test = Test()
>
> Test.run()
>
> What gets printed:
> class hi
>
ls):
print "class hi"
# test = Test()
Test.run()
What gets printed:
class hi
class Test:
@classmethod
def run(cls):
print "class hi"
# test = Test()
Test.run()
What gets printed:
class hi
____
From: Tutkowski, Mike
Sent: Sat
'class hi'
>> 5
>> 6 def run(self):
>> 7 print 'instance hi'
>> 8
>> 9 test = Test()
>> 10
>> 11 test.run()
>>
>> As I suspected, I think this means we have a problem in base.py.
>>
>
lf):
> 7 print 'instance hi'
> 8
> 9 test = Test()
> 10
> 11 test.run()
>
> As I suspected, I think this means we have a problem in base.py.
> ________________
> From: Will Stevens
> Sent: Saturday, April 30, 2
Test()
10
11 test.run()
As I suspected, I think this means we have a problem in base.py.
From: Will Stevens
Sent: Saturday, April 30, 2016 1:46 PM
To: dev@cloudstack.apache.org
Subject: Re: Python Question (with regards to Marvin)
I am on my p
I am on my phone so I have not been able to research this for you. I think
you are right for the most part. Instead of multiple methods, python kind
of fakes overloading by being to have named function arguments which can
have default values, so you can call the method with a dynamic number of
arg
Will - You can override a method in Python, but can you overload it?
http://stackoverflow.com/questions/10202938/how-do-i-use-method-overloading-in-python
> On Apr 30, 2016, at 6:23 AM, Will Stevens wrote:
>
> Here is a pretty good explanation.
>
> http://stackoverflow.com/questions/136097/wha
Allow me to clarify. :-)
host.enableMaintenance(apiclient) is how I was invoking it. Just like a regular
instance method.
For some reason, it wanted to invoke the class method when I did that and was
complaining about the lack of a parameter.
That being the case, I switched my code to the foll
You are probably getting this error because you are trying to call:
Host.enableMaintenance(client)
Check my examples above for how to call it.
Sorry I am on my phone, so I am not very efficient with my phone and cant
civet you better details. :)
On Apr 30, 2016 8:23 AM, "Will Stevens" wrote:
>
Here is a pretty good explanation.
http://stackoverflow.com/questions/136097/what-is-the-difference-between-staticmethod-and-classmethod-in-python
I am guessing that both exist because the function is called both with a
host instance and with the class itself.
Class instance example: `h.enableMa
Hi Mike,
classmethod's first argument is always its class as it is always bound to
the class, which is not the case with normal methods. Thus, both of the
above methods can in essence still co-exist in base.py as they serve
different purposes.
In the latter classmethod, you need to pass your host
Hi everyone,
I received an error when trying to invoke the instance version of
enableMaintenance (below).
'TypeError: enableMaintenance() takes exactly 3 arguments (2 given)\n']
I looked at base.py and it has the following with regards to maintenance mode
for hosts:
def enableMaintena
20 matches
Mail list logo