Re: libseed-list imports.searchPath
- From: Jonatan Liljedahl <lijon kymatica com>
- To: Seed - Gnome Javascript <libseed-list gnome org>
- Subject: Re: libseed-list imports.searchPath
- Date: Fri, 18 Jun 2010 13:15:45 +0200
Yeah, I couldn't understand the weird indentation, which had tabs and
spaces mixed. 4 spaces and no tabs works for everywhere and looks nice.
If someone want to reformat it to that old weird coding style go ahead,
but I don't recognize the rules for it :)
/Jonatan
Alan Knowles wrote:
Committed in with a tiny formatting change
Note that it does not follow the existing CS in the file (which is a bit wierd ;), editing with gtksourceview or scintilla based editors have real problems with tabs/2space combos.. - I'm not too bothered personally about that - but if Rob/Tim would like use to be strict on it, we can change it.
I've also changed the search path as discussed.
Regards
Alan
--- On 18/Jun/2010, Jonatan Liljedahl wrote:
Here's the patch. It does the below, including replacing '.' with
current script_path if set. It also shrank the source by 55 lines.
I've tested it, and everything works as expected. Please apply!
PS: something that didn't work before but now does, is that a
dir_importer object will now allow importing of any existing
libseed_xxx.so modules in that dir.
Regards
/Jonatan
Jonatan Liljedahl wrote:
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
_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]