コード例 #1
0
ファイル: module_def.py プロジェクト: ant0nk/wnframework
    def on_update(self, from_update=0):
        from webnotes import defs
        from webnotes.utils.transfer import in_transfer

        if (not in_transfer) and getattr(defs, 'developer_mode', 0):
            from webnotes.modules.export_module import export_to_files
            export_to_files(record_list=[[self.doc.doctype, self.doc.name]])
コード例 #2
0
 def on_update(self):
   self.set_module()
   
   # export
   if self.doc.standard == 'Yes' and getattr(webnotes.defs, 'developer_mode', 0) == 1:
     from webnotes.modules.export_module import export_to_files
     export_to_files(record_list=[['Search Criteria', self.doc.name]])
コード例 #3
0
ファイル: doctype_mapper.py プロジェクト: Vichagserp/cimworks
	def on_update(self):
		"""
			If developer_mode = 1, mapper will be written to files
		"""
		import webnotes.defs
		if hasattr(webnotes.defs, 'developer_mode') and webnotes.defs.developer_mode:
			from webnotes.modules.export_module import export_to_files
			export_to_files(record_list=[[self.doc.doctype, self.doc.name]])		
コード例 #4
0
ファイル: module_def.py プロジェクト: Vichagserp/cimworks
	def on_update(self, from_update=0):
		from webnotes import defs
		from webnotes.utils.transfer import in_transfer
		
		if (not in_transfer) and getattr(defs,'developer_mode', 0):
			from webnotes.modules.export_module import export_to_files
			export_to_files(record_list=[[self.doc.doctype, self.doc.name]])
			
コード例 #5
0
    def export_doc(self):
        # export
        import conf

        if self.doc.standard == "Yes" and getattr(conf, "developer_mode", 0) == 1:
            from webnotes.modules.export_module import export_to_files

            export_to_files(record_list=[["Search Criteria", self.doc.name]])
コード例 #6
0
    def on_update(self):
        """
			If developer_mode = 1, mapper will be written to files
		"""
        import webnotes.defs
        if hasattr(webnotes.defs,
                   'developer_mode') and webnotes.defs.developer_mode:
            from webnotes.modules.export_module import export_to_files
            export_to_files(record_list=[[self.doc.doctype, self.doc.name]])
コード例 #7
0
ファイル: editdoctype.py プロジェクト: NorrWing/wnframework
def update_field_property(f, property):
	import webnotes

	new = raw_input('New %s: ' % property)
	if new:
		webnotes.conn.begin()
		webnotes.conn.set_value('DocField', f['name'], property, new)
		webnotes.conn.commit()
		export_to_files(record_list=[['DocType', f['parent']]])
		
	return new
コード例 #8
0
ファイル: stylesheet.py プロジェクト: Vichagserp/cimworks
	def on_update(self):
		import webnotes.defs
		
		if hasattr(webnotes.defs, 'developer_mode') and webnotes.defs.developer_mode:
			from webnotes.modules.export_module import export_to_files	
			from webnotes.modules import get_module_path, scurb
			import os
			
			export_to_files(record_list=[['Stylesheet', self.doc.name]])

			file = open(os.path.join(get_module_path(self.doc.module), 'Stylesheet', scrub(self.doc.name), scrub(self.doc.name) + '.html'), 'w')
			file.write(self.doc.content)
			file.close()	
コード例 #9
0
ファイル: page.py プロジェクト: cmrajan/wnframework
	def on_update(self):
		from webnotes.modules.export_module import export_to_files
		from webnotes.modules import get_module_path, scrub
		import os
		from webnotes import defs
		
		if getattr(defs,'developer_mode', 0):
			export_to_files(record_list=[['Page', self.doc.name]])
	
			if self.doc.write_content and self.doc.content:
				file = open(os.path.join(get_module_path(self.doc.module), 'page', scrub(self.doc.name), scrub(self.doc.name) + '.html'), 'w')
				file.write(self.doc.content)
				file.close()
コード例 #10
0
    def on_update(self):
        import webnotes.defs
        from webnotes.modules.export_module import export_to_files
        from webnotes.modules import get_module_path, scrub
        import os

        if hasattr(webnotes.defs,
                   'developer_mode') and webnotes.defs.developer_mode:

            export_to_files(record_list=[['Page Template', self.doc.name]])

            file = open(
                os.path.join(get_module_path(self.doc.module), 'Page Template',
                             self.doc.name, self.doc.name + '.html'), 'w')
            file.write(self.doc.content)
            file.close()
コード例 #11
0
	def on_update(self):
		"""
			Writes the .txt for this page and if write_content is checked,
			it will write out a .html file
		"""
		from webnotes import defs
		from webnotes.utils.transfer import in_transfer
		if not in_transfer and getattr(defs,'developer_mode', 0):
			from webnotes.modules.export_module import export_to_files
			from webnotes.modules import get_module_path, scrub
			import os
			export_to_files(record_list=[['Page', self.doc.name]])
	
			if self.doc.write_content and self.doc.content:
				file = open(os.path.join(get_module_path(self.doc.module), 'page', scrub(self.doc.name), scrub(self.doc.name) + '.html'), 'w')
				file.write(self.doc.content)
				file.close()
コード例 #12
0
ファイル: module_manager.py プロジェクト: cmrajan/wnframework
def change_module(dt, dn, from_module, to_module):
	import os, webnotes.defs
	from webnotes.modules import scrub
	
	# change in db
	webnotes.conn.sql("update `tab%s` set module=%s where name=%s" % (dt, '%s', '%s'), (to_module, dn))
	
	# export files
	from webnotes.modules.export_module import export_to_files
	export_to_files(record_list = [[dt, dn]])
	
	if dt in ['DocType','Page','Search Criteria']:
		dt, dn = scrub(dt), scrub(dn)
		
	# svn add
	webnotes.msgprint(os.popen("svn add %s" % os.path.join(webnotes.defs.modules_path, scrub(to_module), dt, dn)).read())

	# svn remove
	webnotes.msgprint(os.popen("svn remove %s" % os.path.join(webnotes.defs.modules_path, scrub(from_module), dt, dn)).read())
コード例 #13
0
ファイル: page.py プロジェクト: NorrWing/wnframework
	def on_update(self):
		"""
			Writes the .txt for this page and if write_content is checked,
			it will write out a .html file
		"""
		import conf
		from webnotes.utils.transfer import in_transfer
		if not in_transfer and getattr(conf,'developer_mode', 0) and self.doc.standard=='Yes':
			from webnotes.modules.export_module import export_to_files
			from webnotes.modules import get_module_path, scrub
			import os
			export_to_files(record_list=[['Page', self.doc.name]])
	
			# write files
			path = os.path.join(get_module_path(self.doc.module), 'page', scrub(self.doc.name), scrub(self.doc.name))
			
			# html
			if not os.path.exists(path + '.html'):
				with open(path + '.html', 'w') as f:
					f.write("""<div class="layout-wrapper">
	<a class="close" onclick="window.history.back();">&times;</a>
	<h1>%s</h1>
</div>""" % self.doc.title)
					
			# js
			if not os.path.exists(path + '.js'):
				with open(path + '.js', 'w') as f:
					f.write("""wn.pages['%s'].onload = function(wrapper) { }""" % self.doc.name)
			
			# py
			if not os.path.exists(path + '.py'):
				with open(path + '.py', 'w') as f:
					f.write("""import webnotes""")

			# css
			if not os.path.exists(path + '.css'):
				with open(path + '.css', 'w') as f:
					pass
 
			# web page
			self.write_cms_page()
コード例 #14
0
 def on_update(self):
   import webnotes.defs
   if hasattr(webnotes.defs, 'developer_mode') and webnotes.defs.developer_mode:
     from webnotes.modules.export_module import export_to_files
     export_to_files(record_list=[[self.doc.doctype, self.doc.name]])
コード例 #15
0
ファイル: editdoctype.py プロジェクト: NorrWing/wnframework
def remove_field(f):
	webnotes.conn.begin()
	webnotes.conn.sql("""delete from tabDocField where name=%s""", f['name'])
	webnotes.conn.commit()
	export_to_files(record_list=[['DocType', f['parent']]])
コード例 #16
0
ファイル: doctype.py プロジェクト: beliezer/wnframework
	def export_doc(self):
		from webnotes.modules.export_module import export_to_files
		export_to_files(record_list=[['DocType', self.doc.name]])
コード例 #17
0
ファイル: Module Manager.py プロジェクト: ranjithtenz/stable
 def export_module(self, arg):
   from webnotes.modules.export_module import export_to_files
   return export_to_files([arg], record_module = arg)
コード例 #18
0
ファイル: Module Manager.py プロジェクト: ranjithtenz/stable
 def export_item(self, arg):
   from webnotes.modules.export_module import export_to_files
   return export_to_files(record_list = [eval(arg)[0]], record_module = eval(arg)[1])
コード例 #19
0
ファイル: search_criteria.py プロジェクト: ant0nk/wnframework
 def export_doc(self):
     # export
     if self.doc.standard == 'Yes' and getattr(webnotes.defs,
                                               'developer_mode', 0) == 1:
         from webnotes.modules.export_module import export_to_files
         export_to_files(record_list=[['Search Criteria', self.doc.name]])
コード例 #20
0
ファイル: doctype.py プロジェクト: ant0nk/wnframework
 def export_doc(self):
     from webnotes.modules.export_module import export_to_files
     export_to_files(record_list=[['DocType', self.doc.name]])