adzenith wrote:It would also be cool if identically-named files automatically had part of their path names added to their view names so that you could tell them apart.
that's exactly what I was working on. it's working but going to save the file will prompt you to choose where to save... making it much less seamless, even if I were to swap it back on post_save. Jon?
for anyone curious, my renaming method is as follows:
1. get the name of all views (I use a hack for this, but it should be in the api in the future
2. group any views with the same filename
3. find the common suffix of each group (by reversing and using os.path.commonprefix)
4. chop the common suffix, jump to the closest directory separator, hack the pathname based on conditions:
a) if there are one or more folders in the common suffix, prefix /.../ to the filename, otherwise prefix /
b) add the topmost folder name before this
this logic produces results as follows:
output (instead of just showing common.py):
output (instead of just showing __init__.py):