Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 396 → Rev 397

/branches/BR-0.4/basico/services/srv_annotations.py
210,6 → 210,7
 
return valid
 
 
def get_title(self, aid):
ANNOTATION_FILE = LPATH['ANNOTATIONS'] + aid + '.json'
try:
219,6 → 220,7
except:
return None
 
 
def get_content_file(self, aid):
return LPATH['ANNOTATIONS'] + aid + '.adoc'
 
261,6 → 263,33
return matches
 
 
def duplicate_from_template(self, aid):
new_aid = self.gen_aid()
fcname = self.get_content_file(aid)
with open(fcname, 'r') as fc:
content = fc.read()
annotation = self.get_metadata_from_aid(aid)
annotation['AID'] = new_aid
annotation['Type'] = 'Note'
annotation['Content'] = content
self.create(annotation)
 
return new_aid
 
 
def duplicate(self, aid):
new_aid = self.gen_aid()
fcname = self.get_content_file(aid)
with open(fcname, 'r') as fc:
content = fc.read()
annotation = self.get_metadata_from_aid(aid)
annotation['AID'] = new_aid
self.create(annotation)
 
return new_aid
 
 
 
def get_annotations_by_type(self, atype):
selected = set()
aids = self.get_all_aids()
/branches/BR-0.4/basico/services/srv_callbacks.py
613,6 → 613,11
self.gui_annotation_widget_show('', 'create')
 
 
def action_annotation_create_from_template(self, aid):
new_aid = self.srvant.duplicate_from_template(aid)
self.action_annotation_edit(new_aid)
 
 
def action_annotation_create_for_sapnote(self, sid):
self.gui_annotation_widget_show(sid, 'create')
 
/branches/BR-0.4/basico/widgets/wdg_visor_toolbar.py
278,8 → 278,12
self.srvclb.gui_attachment_add()
 
 
def clb_template_changed(self, *args):
self.log.debug(args)
def clb_template_changed(self, combobox):
treeiter = combobox.get_active_iter()
model = combobox.get_model()
aid = model[treeiter][0]
if len(aid) > 0:
self.srvclb.action_annotation_create_from_template(aid)
 
 
def combobox_templates(self, *args):