On 09/25/2016 04:04 PM, Thomas De Schampheleire wrote:

On Sep 25, 2016 15:42, "Mads Kiilerich" <m...@kiilerich.com <mailto:m...@kiilerich.com>> wrote:
>
> On 09/25/2016 03:32 PM, Thomas De Schampheleire wrote:
>>
>> A question that also needs to be answered is: what belongs in kallithea/lib/helpers.py and what in kallithea/lib/utils.py and what in kallithea/lib/utils2.py. Where is the split?
>
>
>
> Yes, it is a mess. I guess that is where experiments must show what is feasible improvements.
>
> I would say that helpers is what is available in templates as 'h' and could/should thus be quite high level and might depend on Pylons and the database.

So actually, anything in helpers that is _not_ directly used from a template should be moved elsewhere (utils, or maybe helpers2? ;-) )


I guess that could make sense. Unless we consider helpers the very high level library that can be used from anywhere.

> (It should thus perhaps not be in lib but in model?)

I think the web framework, like tg2 does, may expect helpers to be in lib. We can tell it about another location, but I don't know if that's worth it.


Hmm. That suggests that my idea of lib as low level and model as more high level doesn't work. That model perhaps should be considered an internal part of lib ... or something like that.

>
> It seems like utils2 generally is quite low level and almost doesn't depend on model. It could thus seem like a/the "real" lib utils.
>
> utils depend much more on model, and parts of it should thus perhaps move to a more high level model utils ... but there are probably also "good" parts of it that can stay in lib.
>

It may perhaps be easier to step away from monolithic files and use topic files like foo_utils and such.


Agreed, that would make it less of a mess. Also, some of the utility functions might be quite high level and doesn't have a natural topic. Except that then that could be the topic ... ;-)

/Mads

_______________________________________________
kallithea-general mailing list
kallithea-general@sfconservancy.org
http://lists.sfconservancy.org/mailman/listinfo/kallithea-general

Reply via email to