Exemplo n.º 1
0
 def testLoad(self):
     jobfile = os.path.join(thislocation, 'testjobs', 'full-bed.svg')
     job = lasersaur.open_file(jobfile)
     if 'vector' in job:
         job['vector']['passes'] = [{
             "paths": [0],
             "feedrate": 4000,
             "intensity": 53
         }]
     jobname = lasersaur.load(job)
     self.assertIn(jobname, lasersaur.listing())
     lasersaur.run(jobname, progress=True)
     print "done!"
Exemplo n.º 2
0
 def testLoad(self):
     jobfile = os.path.join(thislocation,'testjobs','full-bed.svg')
     job = lasersaur.open_file(jobfile)
     if 'vector' in job:
         job['vector']['passes'] = [{
                 "paths":[0],
                 "feedrate":4000,
                 "intensity":53
             }]
     jobname = lasersaur.load(job)
     self.assertIn(jobname, lasersaur.listing())
     lasersaur.run(jobname, progress=True)
     print "done!"
Exemplo n.º 3
0
 def testLoad(self):
     jobfile = os.path.join(thislocation, 'testjobs', 'raster_bat.svg')
     job = lasersaur.open_file(jobfile)
     # if 'vector' in job:
     #     job['vector']['passes'] = [{
     #             "paths":[0],
     #             "feedrate":4000,
     #             "intensity":53
     #         }]
     if 'raster' in job:
         job['raster']['passes'] = [{
             "images": [0],
             "feedrate": 4000,
             "intensity": 53
         }]
     print job.keys()
     pprint.pprint(job['raster']['passes'])
     jobname = lasersaur.load(job)
     self.assertIn(jobname, lasersaur.listing())
     lasersaur.run(jobname, progress=True)
     print "done!"
Exemplo n.º 4
0
 def testLoad(self):
     jobfile = os.path.join(thislocation,'testjobs','raster_bat.svg')
     job = lasersaur.open_file(jobfile)
     # if 'vector' in job:
     #     job['vector']['passes'] = [{
     #             "paths":[0],
     #             "feedrate":4000,
     #             "intensity":53
     #         }]
     if 'raster' in job:
         job['raster']['passes'] = [{
                 "images":[0],
                 "feedrate":4000,
                 "intensity":53
             }]
     print job.keys()
     pprint.pprint(job['raster']['passes'])
     jobname = lasersaur.load(job)
     self.assertIn(jobname, lasersaur.listing())
     lasersaur.run(jobname, progress=True)
     print "done!"
Exemplo n.º 5
0
 def test_queue_library(self):
     # empty job queue
     lasersaur.clear()
     jobs = lasersaur.listing('unstarred')
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     starred = lasersaur.listing('starred')
     self.assertIsInstance(starred, list)
     for job in starred:
         lasersaur.unstar(job)
     lasersaur.clear()
     jobs = lasersaur.listing()
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     #library
     lib = lasersaur.listing_library()
     self.assertIsInstance(lib, list)
     self.assertIn('lasersaur', lib)
     job = lasersaur.get_library('lasersaur')
     self.assertIsInstance(job, dict)
     lasersaur.load_library('lasersaur')
     # queue
     jobs = lasersaur.listing()
     self.assertIsInstance(jobs, list)
     self.assertIn('lasersaur', jobs)
     # get
     job = lasersaur.get('lasersaur')
     self.assertIsInstance(job, dict)
     # list, starring
     jobs = lasersaur.listing('starred')
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     lasersaur.star('lasersaur')
     jobs = lasersaur.listing('starred')
     self.assertIsInstance(jobs, list)
     self.assertIn('lasersaur', jobs)
     jobs = lasersaur.listing('unstarred')
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     lasersaur.unstar('lasersaur')
     jobs = lasersaur.listing('starred')
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     jobs = lasersaur.listing('unstarred')
     self.assertIsInstance(jobs, list)
     self.assertIn('lasersaur', jobs)
     jobs = lasersaur.listing()
     self.assertIsInstance(jobs, list)
     self.assertIn('lasersaur', jobs)
     #del
     lasersaur.remove('lasersaur')
     jobs = lasersaur.listing()
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     #delete of starred file
     lasersaur.load_library('lasersaur')
     lasersaur.star('lasersaur')
     lasersaur.remove('lasersaur')
     jobs = lasersaur.listing()
     self.assertListEqual(jobs, [])
     #constant job nums on add
     for i in range(conf['max_jobs_in_list'] + 3):
         lasersaur.load_library('lasersaur')
     jobs = lasersaur.listing()
     self.assertEqual(len(jobs), conf['max_jobs_in_list'])
     print jobs
     lasersaur.clear()
     jobs = lasersaur.listing()
     self.assertListEqual(jobs, [])
Exemplo n.º 6
0
 def test_queue_library(self):
     # empty job queue
     lasersaur.clear()
     jobs = lasersaur.listing('unstarred')
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     starred = lasersaur.listing('starred')
     self.assertIsInstance(starred, list)
     for job in starred:
         lasersaur.unstar(job)
     lasersaur.clear()
     jobs = lasersaur.listing()
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     #library
     lib = lasersaur.listing_library()
     self.assertIsInstance(lib, list)
     self.assertIn('lasersaur', lib)
     job = lasersaur.get_library('lasersaur')
     self.assertIsInstance(job, dict)
     lasersaur.load_library('lasersaur')
     # queue
     jobs = lasersaur.listing()
     self.assertIsInstance(jobs, list)
     self.assertIn('lasersaur', jobs)
     # get
     job = lasersaur.get('lasersaur')
     self.assertIsInstance(job, dict)
     # list, starring
     jobs = lasersaur.listing('starred')
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     lasersaur.star('lasersaur')
     jobs = lasersaur.listing('starred')
     self.assertIsInstance(jobs, list)
     self.assertIn('lasersaur', jobs)
     jobs = lasersaur.listing('unstarred')
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     lasersaur.unstar('lasersaur')
     jobs = lasersaur.listing('starred')
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     jobs = lasersaur.listing('unstarred')
     self.assertIsInstance(jobs, list)
     self.assertIn('lasersaur', jobs)
     jobs = lasersaur.listing()
     self.assertIsInstance(jobs, list)
     self.assertIn('lasersaur', jobs)
     #del
     lasersaur.remove('lasersaur')
     jobs = lasersaur.listing()
     self.assertIsInstance(jobs, list)
     self.assertListEqual(jobs, [])
     #delete of starred file
     lasersaur.load_library('lasersaur')
     lasersaur.star('lasersaur')
     lasersaur.remove('lasersaur')
     jobs = lasersaur.listing()
     self.assertListEqual(jobs, [])
     #constant job nums on add
     for i in range(conf['max_jobs_in_list'] + 3):
         lasersaur.load_library('lasersaur')
     jobs = lasersaur.listing()
     self.assertEqual(len(jobs), conf['max_jobs_in_list'])
     print jobs
     lasersaur.clear()
     jobs = lasersaur.listing()
     self.assertListEqual(jobs, [])