Re: libseed-list imports.searchPath



Looking at the importer, I see a lot of things I'd like to do:

seed_importer_search() and seed_importer_dir_get_property() actually does the same thing, except seed_importer_search() does it once for each searchpath. I'll do a seed_importer_search_in_dir(dirpath, prop) that is called by both.

In this seed_importer_search_in_dir() I will instead of walking through all directory entries simply:

- is dirpath/prop a file or dir? pass it to seed_importer_handle_file()
- is dirpath/prop.js a file? pass it to seed_importer_handle_file()
- is dirpath/libseed_prop.so a file? pass it to seed_importer_handle_native_module()
- else return NULL

Note the check for .js extension. I really think this is the way to do it, you don't want it to load an old foo.js~ backup file or foo.data or whatever.

Patch coming soon!

/Jonatan

Jonatan Liljedahl wrote:
...
for the importer you could try changing the
seed-importer.c:seed_importer_search

from dir = g_dir_open ((gchar *) walk->data, 0, &e);


to something like this. gchar* sp = seed_value_to_string (ctx, seed_object_get_property (nctx, global, "__script_path__"); exception);

gchar* test_path = (gchar *) walk->data; if (strcmp(test_path, ".")
== 0) { test_path = sp; }

And see how it behaves. Regards Alan

Ok, will try something out.
/Jonatan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]