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