def _job_with_settings(self, *args): settings = Settings(filename='tests/files/job_test_settings.ngc') for key, value in args: settings.set(key, value) job = Job(settings) job.execute() return job
def test_from_old_configfile(self): s = Settings(filename='tests/files/config.ngc') # test integers self.assertEquals(s.get('v_bit_angle'), 60) self.assertEquals(s.get('xscale'), 100) # test booleans self.assertEquals(s.get('var_dis'), False) self.assertEquals(s.get('upper'), True)
def test_casting(self): s = Settings() for var in ('yscale', 'default_text', 'v_bit_angle'): a = type(s.get(var)) s.set(var, 1) self.assertEquals(a, type(s.get(var))) s.set(var, 1.0) self.assertEquals(a, type(s.get(var)))
def test_cast_string(self): s = Settings() s.set('default_text', ' "Test123 " ') self.assertEquals(s.get('default_text'), 'Test123') s.set('default_text', '"bla bla "foo" bla bla"') self.assertEquals(s.get('default_text'), 'bla bla "foo" bla bla')
def test_casting(self): s = Settings() for var in ('yscale', 'text', 'v_bit_angle'): a = type(s.get(var)) s.set(var, 1) self.assertEquals(a, type(s.get(var))) s.set(var, 1.0) self.assertEquals(a, type(s.get(var)))
def test_cast_string(self): s = Settings() s.set('text', ' "Test123 " ') self.assertEquals(s.get('text'), 'Test123') s.set('text', '"bla bla "foo" bla bla"') self.assertEquals(s.get('text'), 'bla bla "foo" bla bla')
def test_new_configfile(self): s = Settings(filename='tests/files/config_newstyle.ngc') # test integers self.assertEquals(s.get('v_bit_angle'), 60) self.assertEquals(s.get('xscale'), 100) # test booleans self.assertEquals(s.get('var_dis'), True) self.assertEquals(s.get('upper'), True) # test strings self.assertEquals(s.get('fontfile'), 'courier.cxf') self.assertEquals(s.get('gcode_preamble'), 'G17 G64 P0.003 M3 S3000 M7') self.assertEquals(s.get('default_text'), 'OOF-Engrave')
def test_new_configfile(self): s = Settings(filename='tests/files/config_newstyle.ngc') # test integers self.assertEquals(s.get('v_bit_angle'), 60) self.assertEquals(s.get('xscale'), 100) # test booleans self.assertEquals(s.get('var_dis'), False) self.assertEquals(s.get('upper'), True) # test strings self.assertEquals(s.get('fontfile'), 'courier.cxf') self.assertEquals(s.get('gcode_preamble'), 'G17 G64 P0.003 M3 S3000 M7') self.assertEquals(s.get('text'), 'Jieter\nbla')
def test_from_old_configfile(self): s = Settings(filename='tests/files/config.ngc') # test integers self.assertEquals(s.get('v_bit_angle'), 60) self.assertEquals(s.get('xscale'), 100) # test booleans self.assertEquals(s.get('var_dis'), True) self.assertEquals(s.get('upper'), True)
def test_get(self): s = Settings() self.assertEquals(s.get('fontdir'), 'fonts')
def f(settings: Settings): if event.new_window_state & Gdk.WindowState.MAXIMIZED: settings.window_state = WindowState.MAXIMIZED else: settings.window_state = WindowState.NORMAL
def test_has_setting(self): s = Settings() self.assertTrue(s.has_setting('origin')) self.assertFalse(s.has_setting('sinterklaas'))
def test_reset(self): s = Settings() self.assertEquals(s.get('fontdir'), 'fonts') s.set('fontdir', 'foobaar') s.reset('fontdir') self.assertEquals(s.get('fontdir'), 'fonts') s.set('fontdir', 'blaat') s.set('gcode_preamble', 'quack') s.reset() self.assertEquals(s.get('fontdir'), 'fonts') self.assertNotEquals(s.get('gcode_preamble'), 'quack')
def test_set(self): s = Settings() s.set('fontdir', 'foobar') self.assertEquals(s.get('fontdir'), 'foobar')
def f(settings: Settings): settings.main_split_position = position
- [Fixed problem that can cause the program to freeze if the saved settings contain errors.] - [Fixed problem that can cause the program to freeze if the saved settings contain errors.] 1.67 - Improved DXF import for DXF files with some incomplete data - Fixed curve fitting upon g-code export. Limited curve fitting angle to avoid curve fitting sharp corners. 1.68 - [Fixed typo in code introduced in v1.67 that broke curve fitting.] Version 1.69b - align with f-engrave v1.69: - A couple of minor fixes to keep things working in Python 3.x - [Added ability to disable plotting of v-carve toolpath and area] - Fixed problem causing v-carve path to go outside of design bounds for very thin design sections. """ # TODO insert psyco / pypy settings = Settings(autoload=True) if settings.get('batch'): # batch processing pass else: from util import icon from application.gui import Gui try: from tkinter import * from tkinter.filedialog import * except: from Tkinter import * from tkFileDialog import *
def test_get_bonus_string(self): """test function get_bonus_string""" self.assertEqual(Settings.get_bonus_string() == 'Bonus: On'\ , CONFIGURATION.allow_bonuses) self.assertEqual(Settings.get_bonus_string() == 'Bonus: Off'\ , (CONFIGURATION.allow_bonuses == False))
- Fixed v-bit cleanup step over. Generated step was twice the input cleanup step. - Updated icon. - Added console version of application to windows distribution. For batch mode in Windows. Version 1.64 - Fixed bug that created erroneous lines in some circumstances during v-carving. - Mapped save function to Control-S for easier g-code saving. Version 1.65 - Fixed bug in sort_for_v_carve that resulted in an error for certain designs. Version 1.65b - OOF-Engrave: refactored F-Engrave source code. """ # TODO insert psyco / pypy settings = Settings(autoload=True) if settings.get('batch'): # batch processing pass else: from util import icon from application.gui import Gui try: from tkinter import * from tkinter.filedialog import * except: from Tkinter import * from tkFileDialog import *
def f(settings: Settings): settings.editor_viewer_split_position = position