Assets, paths… Need some help putting together examples

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

  • #16108


    jondecker76

    Participant

    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.csv

    However, 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!

    #16109


    Amon

    Participant

    try changing

    “assets::test.csv”

    to

    “asset::test.csv”

    #16110

    abakobo

    Participant

    Just 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/”

    #16111


    jondecker76

    Participant

    Doh!  I found my problem…  I didn’t have a:

    #16112

    DruggedBunny

    Participant

    Just to be sure, it should be “asset::test.csv” to use the correct assets dir!

    #16113


    jondecker76

    Participant

    yep, sorry.  Just a typo

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.