Exemplo n.º 1
0
    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')
Exemplo n.º 2
0
    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')
Exemplo n.º 3
0
    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)))
Exemplo n.º 4
0
    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)))
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
    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)
Exemplo n.º 7
0
    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')
Exemplo n.º 8
0
    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')
Exemplo n.º 9
0
    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')
Exemplo n.º 10
0
    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')
Exemplo n.º 11
0
             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 *

    root = Tk()
Exemplo n.º 12
0
    def test_get(self):
        s = Settings()

        self.assertEquals(s.get('fontdir'), 'fonts')
Exemplo n.º 13
0
    def test_set(self):
        s = Settings()

        s.set('fontdir', 'foobar')

        self.assertEquals(s.get('fontdir'), 'foobar')
Exemplo n.º 14
0
                 - 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 *

    root = Tk()
Exemplo n.º 15
0
    def test_get(self):
        s = Settings()

        self.assertEquals(s.get('fontdir'), 'fonts')
Exemplo n.º 16
0
    def test_set(self):
        s = Settings()

        s.set('fontdir', 'foobar')

        self.assertEquals(s.get('fontdir'), 'foobar')