Example #1
0
 def testBasic(self):
     c = self.userConfig
     fm = fractmain.T(c)
     options = Arguments().parse_args(["--save", "foo.png"])
     fm.run(options)
     self.assertTrue(os.path.exists("foo.png"))
     os.remove("foo.png")
Example #2
0
    def testBuildOnly(self):
        c = self.userConfig
        fm = fractmain.T(c)
        options = Arguments().parse_args(["--buildonly", "test.so"])

        fm.run(options)
        self.assertTrue(os.path.exists("test.so"))
        os.remove("test.so")
        if os.path.exists("test.so.c"):
            os.remove("test.so.c")
Example #3
0
def main(args):
    opts = Arguments()
    try:
        opts.parse_args(args)
    except SystemExit as err:
        print("Error parsing arguments: %s" % ', '.join(args))
        return 1

    userConfig = fractconfig.userConfig()
    t = fractmain.T(userConfig)
Example #4
0
def main(args):
    opts = options.T()
    try:
        opts.parse(args)
    except options.OptionError as err:
        print(get_version_info())
        print(opts.help())

        print("Error parsing arguments: %s" % err)
        return 1

    t = fractmain.T()
Example #5
0
    def run_nogui(self):
        userConfig = fractconfig.userConfig()
        main = fractmain.T(userConfig)
        times = []
        last_time = now()
        for file in files:
            main.load(file)
            opts = Arguments().parse_args(sys.argv[1:])
            main.run(opts)
            new_time = now()
            times.append(new_time - last_time)

        return times
Example #6
0
    def run_nogui(self):
        main = fractmain.T()
        print main.compiler.path_lists
        times = []
        last_time = now()
        for file in files:
            main.load(file)
            im = image.T(self.w, self.h)
            main.draw(im)
            im.save(file + ".png")
            new_time = now()
            times.append(new_time - last_time)

        return times
Example #7
0
    def testSinglePoint(self):
        c = self.userConfig
        fm = fractmain.T(c)
        options = Arguments().parse_args(["--singlepoint"])

        fm.run(options)
Example #8
0
#!/usr/bin/env python

# gettext
import gettext

os.environ.setdefault('LANG', 'en')
if os.path.isdir('po'):
    gettext.install('gnofract4d', 'po')
else:
    gettext.install('gnofract4d')

# nogui modules
from fract4d import fractal, fractmain, options


def main(args):
    opts = options.T()
    try:
        opts.parse(args)
    except options.OptionError, err:
        print get_version_info()
        print opts.help()

        print "Error parsing arguments: %s" % err
        return 1

    t = fractmain.T()