About Monkey 2 › Forums › Monkey 2 Programming Help › Assets, paths… Need some help putting together examples
This topic contains 5 replies, has 4 voices, and was last updated by jondecker76 1 day, 8 hours ago.
Viewing 6 posts - 1 through 6 (of 6 total)
-
Author
Posts
-
March 5, 2019 at 5:30 pm #16108
I’ve written a number of modules that I would like to release (SQL wrapper module, CSV flatfile module shich is an extension to the SQL wrapper module (lets you import and export flatfiles so that you can use SQL on them), and a few others.
I now have a tests/ subfolder in each module folder, where I’m trying to put a few really good examples together. The CSV module specifically I would like to include sample CSV files, and this is where I’m having a problem… I can load my CSV files in great if I know the full path.. But I’m having problems making it work in cases where I don’t know the full path to the modules folder.
For example, my path for examples of my CSV module is /home/viavacavi/Dropbox/monkey2/modules/csv/tests…
Now that I’m trying to ready this for release, I can’t seem to get it to work like I would expect it to. For example, I have added the follwing:
/home/viavacavi/Dropbox/monkey2/modules/csv/tests/assets/test.csvHowever, I can’t load it (using filestream) with “assets::test.csv”
I’ve also tried AssetsPath()+”test.csv” with no luck. It turns out that AssetsPath()=/home/viavacavi/Dropbox/monkey2/modules/csv/tests/test1.products/Linux/assets/. In my case this is just an empty folder – so it’s like my assets directory in /home/viavacavi/Dropbox/monkey2/modules/csv/tests/ is not being copied over to the build folder? I could hack at the AssetPath string to remove the build folder parts, but surely this can’t be the way it was meant to be used? I can’t find any bananas that could shed some light on this..
Any insights?
Thanks!
March 5, 2019 at 6:28 pm #16109
AmonParticipanttry changing
“assets::test.csv”
to
“asset::test.csv”
March 5, 2019 at 6:53 pm #16110
abakobo
ParticipantJust use a relative path (to your monkey2 file) and “asset::blah.bla” as amon told
Note that you can use ‘../’ to go to relative parent directory. eg “../assets/mycsv.csv”
you can also use the @ symbol to create virtual asset dirs.
eg #Import “../assets/images/@/images/”March 5, 2019 at 9:13 pm #16111Doh! I found my problem… I didn’t have a:
Monkey12#Import "assets/test.csv"March 6, 2019 at 3:26 am #16112Just to be sure, it should be “asset::test.csv” to use the correct assets dir!
March 6, 2019 at 2:25 pm #16113yep, sorry. Just a typo
-
Author
Posts
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.