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]])
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]])
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]])
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]])
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]])
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
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()
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()
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()
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()
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())
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();">×</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()
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]])
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']]])
def export_doc(self): from webnotes.modules.export_module import export_to_files export_to_files(record_list=[['DocType', self.doc.name]])
def export_module(self, arg): from webnotes.modules.export_module import export_to_files return export_to_files([arg], record_module = arg)
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])
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]])