示例#1
0
def test_templates():
    fname = path(__file__).parent / 'generated_schematic_templates.txt'
    f = open(fname, 'w')
    for p in Project.all():
        print p.name
        f.write('\n*******************************  ')
        f.write(p.name)
        f.write('  *******************************\n')
        f.write(p.schematic.template)
    f.close()
示例#2
0
def test_schematics():
    fname = path(__file__).parent / 'generated_schematics.txt'
    f = open(fname, 'w')
    for p in Project.all():
        print p.name
        f.write('\n*******************************  ')
        f.write(p.name)
        f.write('  *******************************\n')
        try:
            f.write(p.schematic.text)
        except ValueError as e:
            f.write(str(e))
    f.close()
示例#3
0
def schematic(cog, projname):
    cog.outl()
    cog.outl('Schematic::')
    cog.outl()
    cog.outl(Project(projname).schematic.text)
示例#4
0
 def _project_default(self):
     x = Project.find(self.configfile.get('project'))
     if x:
         return x
     else:
         return projects[-1]
示例#5
0
from elme.util import tmpdir
from path import path
from traits.trait_types import Any, Enum, CSet, List, Button, Str
from traitsui.editors.code_editor import CodeEditor
from traitsui.editors.enum_editor import EnumEditor
from traitsui.group import HGroup, Group, Tabbed
from traitsui.item import Item
from traitsui.message import message
from traitsui.view import View
from zipfile import ZipFile
import tempfile
import traceback
import webbrowser


projects = Project.all()
HOME_DIR = path('~').expanduser() / ".measurements"


def open_text_file_in_editor(file_path):
    webbrowser.open_new_tab(file_path)
#        os.system('gnome-open '+file_path)


def open_string_in_editor(s):
    file_out = tempfile.NamedTemporaryFile(
        prefix='measurement_', suffix='', delete=0)
    file_out.close()
    path(file_out.name).write_text(s)
    open_text_file_in_editor(file_out.name)
示例#6
0
def main(project, plot='analog_value_time_plot', zipfilename=''):
    Project(project).plot(plot).display(zipfilename)
示例#7
0
 def _project_default(self):
     x = Project.find(self.configfile.get('project'))
     if x:
         return x
     else:
         return projects[-1]
示例#8
0
from elme.project import Project
from elme.util import tmpdir
from path import path
from traits.trait_types import Any, Enum, CSet, List, Button, Str
from traitsui.editors.code_editor import CodeEditor
from traitsui.editors.enum_editor import EnumEditor
from traitsui.group import HGroup, Group, Tabbed
from traitsui.item import Item
from traitsui.message import message
from traitsui.view import View
from zipfile import ZipFile
import tempfile
import traceback
import webbrowser

projects = Project.all()
HOME_DIR = path('~').expanduser() / ".measurements"


def open_text_file_in_editor(file_path):
    webbrowser.open_new_tab(file_path)


#        os.system('gnome-open '+file_path)


def open_string_in_editor(s):
    file_out = tempfile.NamedTemporaryFile(prefix='measurement_',
                                           suffix='',
                                           delete=0)
    file_out.close()