summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2012-12-10 12:46:18 +0200
committerYakov Goldberg <yakov.g@samsung.com>2012-12-10 18:15:25 +0200
commitc7d1b4f6c4f955397259a40436f6c13dda4894b8 (patch)
tree9e5a63bdccb6eb2f61b7ba4883cf316fd093d40e
parent7eedd55a8522c04638e6f0918d681a568dc33f4b (diff)
JS Generation: some fixes in file saving
Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
-rw-r--r--eoparser/xmlparser.py17
-rw-r--r--examples/elw_button_new_names.js1
2 files changed, 11 insertions, 7 deletions
diff --git a/eoparser/xmlparser.py b/eoparser/xmlparser.py
index 0c7cd35..80b60cd 100644
--- a/eoparser/xmlparser.py
+++ b/eoparser/xmlparser.py
@@ -622,7 +622,7 @@ class JsVisitor(Visitor):
622 self.h_file.name = _o.cl_obj.js_h_file 622 self.h_file.name = _o.cl_obj.js_h_file
623 623
624 self.c_file.header.append("/**\n * generated from \"%s\"\n */\n"%(_o.cl_obj.source_file)) 624 self.c_file.header.append("/**\n * generated from \"%s\"\n */\n"%(_o.cl_obj.source_file))
625 self.c_file.header.append("#include \"%s\"\n"%(os.path.split(_o.cl_obj.js_h_file)[1] )) 625 self.c_file.header.append("#include \"%s\"\n"%_o.cl_obj.js_h_file)
626 self.c_file.header.append("namespace elm {\n\n") 626 self.c_file.header.append("namespace elm {\n\n")
627 self.c_file.header.append("using namespace v8;\n\n") 627 self.c_file.header.append("using namespace v8;\n\n")
628 628
@@ -685,7 +685,7 @@ class JsVisitor(Visitor):
685 685
686 self.class_info.protected.append(" virtual ~%s();\n"%(_o.cl_obj.kl_id)) 686 self.class_info.protected.append(" virtual ~%s();\n"%(_o.cl_obj.kl_id))
687 687
688 #saving data to pxi file 688 #saving data to cc file
689 def js_cc_file_to_dir_save(self, _outdir): 689 def js_cc_file_to_dir_save(self, _outdir):
690 lines = [] 690 lines = []
691 691
@@ -712,7 +712,9 @@ class JsVisitor(Visitor):
712 lines.append(line) 712 lines.append(line)
713 713
714 lines.append("\n} //end namespace elm\n\n") 714 lines.append("\n} //end namespace elm\n\n")
715 f = open (self.c_file.name, 'w') 715
716
717 f = open(os.path.join(_outdir, self.c_file.name), 'w')
716 for line in lines: 718 for line in lines:
717 f.write(line) 719 f.write(line)
718 f.close() 720 f.close()
@@ -771,7 +773,7 @@ class JsVisitor(Visitor):
771 lines.append("\n") 773 lines.append("\n")
772 lines.append("#endif\n") 774 lines.append("#endif\n")
773 775
774 f = open (self.h_file.name, 'w') 776 f = open(os.path.join(_outdir, self.h_file.name), 'w')
775 for line in lines: 777 for line in lines:
776 f.write(line) 778 f.write(line)
777 f.close() 779 f.close()
@@ -1549,7 +1551,8 @@ class XMLparser(object):
1549 #saving files 1551 #saving files
1550 for n, o in self.objects.items(): 1552 for n, o in self.objects.items():
1551 o.V.pxi_file_to_dir_save(outdir) 1553 o.V.pxi_file_to_dir_save(outdir)
1552 #o.V.pxd_file_to_dir_save(outdir) 1554
1555 #saving all pxd data in one file
1553 (l, name) = o.V.get_pxd_lines_from_module() 1556 (l, name) = o.V.get_pxd_lines_from_module()
1554 lines += l 1557 lines += l
1555 names.append(name) 1558 names.append(name)
@@ -1606,8 +1609,8 @@ class XMLparser(object):
1606 1609
1607 self.normalize_module_names() 1610 self.normalize_module_names()
1608 for n, o in self.objects.items(): 1611 for n, o in self.objects.items():
1609 o.js_h_file = os.path.join(outdir, "_" + o.mod_name + ".h") 1612 o.js_h_file = "_" + o.mod_name + ".h"
1610 o.js_cc_file = os.path.join(outdir, "_" + o.mod_name + ".cc") 1613 o.js_cc_file = "_" + o.mod_name + ".cc"
1611 1614
1612 eo_base_ops = ["INIT", "EO_BASE_SUB_ID_EVENT_FREEZE", "EO_BASE_SUB_ID_EVENT_FREEZE_GET", "EO_BASE_SUB_ID_EVENT_THAW", "EO_BASE_SUB_ID_EVENT_GLOBAL_FREEZE", "EO_BASE_SUB_ID_EVENT_GLOBAL_THAW"] 1615 eo_base_ops = ["INIT", "EO_BASE_SUB_ID_EVENT_FREEZE", "EO_BASE_SUB_ID_EVENT_FREEZE_GET", "EO_BASE_SUB_ID_EVENT_THAW", "EO_BASE_SUB_ID_EVENT_GLOBAL_FREEZE", "EO_BASE_SUB_ID_EVENT_GLOBAL_THAW"]
1613 1616
diff --git a/examples/elw_button_new_names.js b/examples/elw_button_new_names.js
index c906a64..7dd40b5 100644
--- a/examples/elw_button_new_names.js
+++ b/examples/elw_button_new_names.js
@@ -1,5 +1,6 @@
1//var elm = require('jse'); 1//var elm = require('jse');
2var elm = require('jse'); 2var elm = require('jse');
3//var elm = require('/opt/e17/lib/elev8/linux-gnu-i686-0.1.0/libjse.so');
3 4
4//var m = new elm.Mixin() 5//var m = new elm.Mixin()
5 6