Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 3
0
def schematic(cog, projname):
    cog.outl()
    cog.outl('Schematic::')
    cog.outl()
    cog.outl(Project(projname).schematic.text)
Ejemplo n.º 4
0
 def _project_default(self):
     x = Project.find(self.configfile.get('project'))
     if x:
         return x
     else:
         return projects[-1]
Ejemplo n.º 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)
Ejemplo n.º 6
0
def main(project, plot='analog_value_time_plot', zipfilename=''):
    Project(project).plot(plot).display(zipfilename)
Ejemplo n.º 7
0
 def _project_default(self):
     x = Project.find(self.configfile.get('project'))
     if x:
         return x
     else:
         return projects[-1]
Ejemplo n.º 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()