def ParseFromLayout()

in tsqa/environment.py [0:0]


    def ParseFromLayout(self, path):
        """
        Parse the output of traffic_layout to instantiate a Layout object. This
        has a terrible name, and probably needs to die, but it is helpful for
        now since we can use it to bootstrap an environment from something we
        already have installed.
        """
        layout = Layout(None)
        stdout, _ = tsqa.utils.run_sync_command(path,
                                                shell=False,
                                                stdout=subprocess.PIPE,
                                                )
        for line in stdout.splitlines():
            key, val = line.split(': ', 1)
            setattr(layout, key.lower(), val)

        return layout