First off, sincere thanks to whoever created the training manual (and the gentle intro). Very much appreciated. (below is a minor issue....)
I too can't find conf.py on a Windows install, nor is there any documentation that I can find how to create one, what the syntax is, or where to place it? I see there is a config.py (not just conf.py) deep in the system that contains quite a bit of script.
I'm new to QGIS and to python so I don't know exactly what they mean by "tokens". I understand four tokens are reported needed in the training. (more below. Its easy to search on those words in the Training PDF).
Looks to me like the PDF may have a typo? conf.py should have been config.py? If so it still needs syntax info and where to place the new, modified config.py file. Is there a hierarchy of reading various config.py files? Do you put the "user modifed" config.py file near the QGIS project file so you don't mess up other python based programs on the system? None python experts would like to know...
At any rate, here are the 4 "tokens" mentioned in the PDF and the default values for the shipped sample files.
- majorUrbanName "Swellendam"
- largeLandUseArea "Bontebok National Park"
- srtmFileName srtm_41_19.tif [not sure if these need " ?]
- localCRS WGS 84 / UTM 34S
I'm only up to Ch 5 so I've only encountered one "token" so far.
- "name" = ’ |majorUrbanName| ’
Minor issue - the apostrophe is "irregular" in the PDF - so replaced those ’ with the standard straight down (ASCII) '.
In the above "majorUrbanName" is set off in pipes and is assumed to be a "token" somehow set up in the conf.py file? Initially (not having read the intro material on using a custom data training set) I speculated the pipes stood for a some type of enumerated list, way off the mark.
If you are following the default data set, vs using your own custom one, its easy to just perform your own manual "token substitution" on the PDF tutorial side. Just convert the PDF to read:
Enter that into the expression editor and the tutorial works fine. I assume this will also work going forward after ch 5.
BTW - I have no ideal if double quotes (") are different from single ones (') in QGIS / Python so it would be great to cover that in the docs. Also, I'm feeling a bit "naked" in terms of understanding the nuances of the expression editor itself and how that may differ from other, traditional RDBMS / SQL syntax? Hopefully covered in a future chapter, or in the User Manual. Very appreciative of the Test function! Perhaps a very brief python syntax as it relates to QGIS up front would be helpful (especially as it relates to token substitution, single and double quotes, capitalization, use in the expression editor, etc.)
Speculating there was perhaps supposed to be a config.py file shipped with the sample data? However no reference in the README of it, or where it would need to be moved to to enable it to be read properly on startup.
Or... perhaps all this "token" substitution was to occur in producing a customized PDF for students?