Hi Peter,
The templater is awesome! I tried it out and it works just great! The code is perfectly readable too! I only allowed myself to modify the usage description a bit (check developers/peter/calitko-templates). When you say you’re done with it I’ll merge it to the main branch!
Thanks :). I’ll check it.
I was thinking, should we move the dir templater to Utils just in order to have less top-level dirs? We could also create a tiny script in ‘.’ that just “delegates” to Utils/templater/templater.py or templater/templater.py - this way could invoke the script from the project root. OK, we could say templater/templater.py -t templater/Templates …
Yes, that shouldn’t be a problem (the movement) - see also my comments below.
I was also thinking that we could move all Calitko packages in a dir Calitko, so that we could have a structure like this:
- 3rdParty (cppunit, moc, qmake)
- Calitko (Protocols, Services, UIs)
- CalitkoMocks
- templater
I agree - this will also move files like MainWindow.{cpp,h} outside the root directory, so there will remain only makefiles, project files etc., but no source files. It will become definitely more well-arranged.
I’m thinking about something like this, you can check it out, too:
- 3rdParty (cppunit, moc, qmake)
- Sources (Protocols, UIs, Utils, CalitkoMocks, …)
- Utils (templater and other possible stuff that don’t belong to the Sources directory)
- Docs
- AppData (Xml, Icons and other things needed in runtime)
I have also one another idea - let me know if you have already tried it or you dislike it or there are some problems with it (implementation, …). In our last C++ team project we had an Obj directory where we put every *.[o|a] file so they were all only in one place and we had our Sources directory always “clean”.
It would be nice if we have another script that could check whether all packages have Imports.h and Imports.cpp and that all modules have the guards and the namespaces. Automatically fixing these if a package gets move to another package or a module gets renamed or moved my be difficult, but if we have an indication that certain patterns are not found in the file, it would be some help. Maybe we the templater could be extended to verify the templates are not “corrupted”?
Ok, I can try to create something that will perform such actions. First I’ll need to do some refactoring (to make the script easier to extense this way). This script was initially ment to be a stand-alone script but now I’m thinking that it would be much better to split it into more modules and create two stand-alone scripts (template-creator.py and template-checker.py, names can be different) and each one of them will perform just one kind of actions. What do you think?
Petr
