def import_robot(robot_name):
- exec("from Robots import bkmk_r%s" % robot_name)
- exec("robot = bkmk_r%s.robot_%s" % (robot_name, robot_name))
- return robot
+ ns = locals()
+ exec("from Robots import bkmk_r%s" % robot_name, globals(), ns)
+ exec("robot = bkmk_r%s.robot_%s" % (robot_name, robot_name), globals(), ns)
+ return ns['robot']
robot = import_robot(robot_name)
def import_storage(storage_name):
- exec("from Storage import bkmk_st%s" % storage_name)
- exec("storage = bkmk_st%s.storage_%s" % (storage_name, storage_name))
- return storage
+ ns = locals()
+ exec("from Storage import bkmk_st%s" % storage_name, globals(), ns)
+ exec("storage = bkmk_st%s.storage_%s" % (storage_name, storage_name), globals(), ns)
+ return ns['storage']
storage = import_storage(storage_name)
def import_writer(writer_name):
- exec("from Writers import bkmk_w%s" % writer_name)
- exec("writer = bkmk_w%s.writer_%s" % (writer_name, writer_name))
- return writer
+ ns = locals()
+ exec("from Writers import bkmk_w%s" % writer_name, globals(), ns)
+ exec("writer = bkmk_w%s.writer_%s" % (writer_name, writer_name), globals(), ns)
+ return ns['writer']
writer = import_writer(writer_name)