[PATCH PoC] hacks: the concept of python files that will be loaded and can monkeypatch Kallithea internals

Mads Kiilerich mads at kiilerich.com
Tue Apr 21 09:05:15 EDT 2015


On 04/21/2015 06:34 AM, Thomas De Schampheleire wrote:
>
>> +import imp
>>   import logging
>>   import kallithea
>>   import platform
>> @@ -43,12 +45,25 @@ from kallithea.model.scm import ScmModel
>>   log = logging.getLogger(__name__)
>>
>>
>> +def load_hacks():
>> +    """
>> +    Load hacks - python files dropped in kallithea/hacks that will monkeypatch
>> +    Kallithea internals
>> +    """
>> +    hacksdir = os.path.dirname(__file__) + '/../hacks'
> This should better be
>
> hacksdir = os.path.join(os.path.dirname(__file__), os.pardir, 'hacks')

More verbose, yes, but will it really be better? It is less readable to me.

/Mads


More information about the kallithea-general mailing list