Example #1
0
 def test_list_profiles_profiledir(self):
     profiledir = tempfile.mkdtemp()
     try:
         self.assertEqual([], list(makerbot_driver.list_profiles(profiledir)))
         path = os.path.join(profiledir, "Test.json")
         with open(path, "w") as fp:
             values = {"key": "value"}
             json.dump(values, fp)
         self.assertEqual(["Test"], list(makerbot_driver.list_profiles(profiledir)))
     finally:
         shutil.rmtree(profiledir)
Example #2
0
 def test_list_profiles_profiledir(self):
   profiledir = tempfile.mkdtemp()
   try:
     self.assertEqual([], list(makerbot_driver.list_profiles(profiledir)))
     path = os.path.join(profiledir, 'Test.json')
     with open(path, 'w') as fp:
       values = {'key':'value'}
       json.dump(values, fp)
     self.assertEqual(['Test'], list(makerbot_driver.list_profiles(profiledir)))
   finally:
     shutil.rmtree(profiledir)
Example #3
0
 def test_list_profiles_profiledir(self):
     profiledir = tempfile.mkdtemp()
     try:
         self.assertEqual([],
                          list(makerbot_driver.list_profiles(profiledir)))
         path = os.path.join(profiledir, 'Test.json')
         with open(path, 'w') as fp:
             values = {'key': 'value'}
             json.dump(values, fp)
         self.assertEqual(['Test'],
                          list(makerbot_driver.list_profiles(profiledir)))
     finally:
         shutil.rmtree(profiledir)
Example #4
0
 def create(config, profile_dir):
     driver = S3gDriver(config, profile_dir)
     for profile_name in makerbot_driver.list_profiles(profile_dir):
         s3g_profile = makerbot_driver.Profile(profile_name, profile_dir)
         profile = _S3gProfile._create(profile_name, driver, s3g_profile)
         driver._profiles[profile.name] = profile
     return driver
Example #5
0
 def test_list_profiles(self):
     expected_profiles = [
         'ReplicatorDual',
         'ReplicatorSingle',
     ]
     self.assertEqual(sorted(expected_profiles),
                      sorted(list(makerbot_driver.list_profiles())))
Example #6
0
 def create(config, profile_dir):
     driver = S3gDriver(config, profile_dir)
     for profile_name in makerbot_driver.list_profiles(profile_dir):
         s3g_profile = makerbot_driver.Profile(profile_name, profile_dir)
         profile = _S3gProfile._create(profile_name, driver, s3g_profile)
         driver._profiles[profile.name] = profile
     return driver
Example #7
0
 def test_list_profiles(self):
     expected_profiles = [
         'ReplicatorDual',
         'ReplicatorSingle',
         'TOMStepstruderSingle',
         'TOMStepstruderDual',
         'Replicator2',
         'Replicator2X',
     ]
     for profile in expected_profiles:
         self.assertTrue(profile in makerbot_driver.list_profiles())
Example #8
0
 def test_list_profiles(self):
     expected_profiles = [
         'ReplicatorDual',
         'ReplicatorSingle',
         'TOMStepstruderSingle',
         'TOMStepstruderDual',
         'Replicator2',
         'Replicator2X',
     ]
     for profile in expected_profiles:
         self.assertTrue(profile in makerbot_driver.list_profiles())
Example #9
0
 def _getprinters(self):
     result = []
     profiledir = self._config['common']['profiledir']
     profile_names = list(makerbot_driver.list_profiles(profiledir))
     for profile_name in profile_names:
         if 'recipes' != profile_name:
             profile = makerbot_driver.Profile(profile_name, profiledir)
             printer = conveyor.domain.Printer.fromprofile(
                 profile, profile_name, None)
             printer.can_print = False
             dct = printer.todict()
             result.append(dct)
     printerthreads = self._server.getprinterthreads()
     for portname, printerthread in printerthreads.items():
         profile = printerthread.getprofile()
         printerid = printerthread.getprinterid()
         printer = conveyor.domain.Printer.fromprofile(
             profile, printerid, None)
         dct = printer.todict()
         result.append(dct)
     return result
Example #10
0
 def _getprinters(self):
     result = []
     profiledir = self._config['common']['profiledir']
     profile_names = list(makerbot_driver.list_profiles(profiledir))
     for profile_name in profile_names:
         if 'recipes' != profile_name:
             profile = makerbot_driver.Profile(profile_name, profiledir)
             printer = conveyor.domain.Printer.fromprofile(
                 profile, profile_name, None)
             printer.can_print = False
             dct = printer.todict()
             result.append(dct)
     printerthreads = self._server.getprinterthreads()
     for portname, printerthread in printerthreads.items():
         profile = printerthread.getprofile()
         printerid = printerthread.getprinterid()
         printer = conveyor.domain.Printer.fromprofile(
             profile, printerid, None)
         dct = printer.todict()
         result.append(dct)
     return result
Example #11
0
 def test_list_profiles(self):
     expected_profiles = ["ReplicatorDual", "ReplicatorSingle", "TOMStepstruder", "Replicator2"]
     self.assertEqual(sorted(expected_profiles), sorted(list(makerbot_driver.list_profiles())))
Example #12
0
 def test_list_profiles(self):
   expected_profiles = [
       'ReplicatorDual',
       'ReplicatorSingle',
       ]
   self.assertEqual(sorted(expected_profiles), sorted(list(makerbot_driver.list_profiles())))