示例#1
0
# -*- coding: utf-8 -*-
"""
Created on Sat Aug  8 13:14:49 2015

@author: koehler
"""
from worknote import Worknote
try:
    from worknote.QNoteOrganizer import edit_note
except ImportError:
    print "This testbench needs to be executed from outside this module"
    print "Copy this file to a higher level and execute"
    import sys
    sys.exit()
wn = Worknote("./test")
wn("First slide ", cat='slide')
wn(" A lot of Text")
wn("*  bbb")
wn("*  Some text")
wn("*  bbb")
wn("Second slide ", cat='slide')
wn("# enumerated")
wn("bla")
wn("Third slide", cat='slide')
wn([['First column','Second Column', 'Third Column'],[1.,2.,3.],[4,5,6]], cat='table')
edit_note(wn)
wn.build()
示例#2
0
    """
    Return unicode string

    Args:
    -----
    text : str, unicode
        Text can be string or unicode

    Returns
    -------
    text : unicode
    """
    if type(text) == str:
        text = unicode(text, 'utf-8')
    return text''',
   cat='code')
wn.build()  #build function to be implemented , see ./test/beamer.tex
wn.build(style='Report')
wn.build(style='Markdown')
wn1_output = wn.get_text()
wn.save()
wn2 = Worknote()
wn2.load('./test')
wn2_output = wn.get_text()
if wn1_output == wn2_output:
    print 'Saving and loading successful.'
else:
    print 'ERROR: There were differences in the saved and loaded data'

print unicode(wn)
示例#3
0
# -*- coding: utf-8 -*-
"""
Created on Sat Aug  8 13:14:49 2015

@author: koehler
"""
from worknote import Worknote
try:
    from worknote.QNoteOrganizer import edit_note
except ImportError:
    print "This testbench needs to be executed from outside this module"
    print "Copy this file to a higher level and execute"
    import sys
    sys.exit()
wn = Worknote("./test")
wn("First slide ", cat='slide')
wn(" A lot of Text")
wn("*  bbb")
wn("*  Some text")
wn("*  bbb")
wn("Second slide ", cat='slide')
wn("# enumerated")
wn("bla")
wn("Third slide", cat='slide')
wn([['First column', 'Second Column', 'Third Column'], [1., 2., 3.], [4, 5, 6]
    ],
   cat='table')
edit_note(wn)
wn.build()
示例#4
0
wn('''def set_unicode(text):
    """
    Return unicode string

    Args:
    -----
    text : str, unicode
        Text can be string or unicode

    Returns
    -------
    text : unicode
    """
    if type(text) == str:
        text = unicode(text, 'utf-8')
    return text''', cat = 'code')
wn.build()   #build function to be implemented , see ./test/beamer.tex
wn.build(style='Report')
wn.build(style='Markdown')
wn1_output = wn.get_text()
wn.save()
wn2 = Worknote()
wn2.load('./test')
wn2_output = wn.get_text()
if wn1_output == wn2_output:
    print 'Saving and loading successful.'
else:
    print 'ERROR: There were differences in the saved and loaded data'
    
print unicode(wn)