brintos

brintos / llvm-project-archived public Read only

0
0
Text · 965 B · 4478419 Raw
31 lines · python
1# DExTer : Debugging Experience Tester2# ~~~~~~   ~         ~~         ~   ~~3#4# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5# See https://llvm.org/LICENSE.txt for license information.6# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7"""Commmand sets the path for all following commands to 'declared_file'.8"""9 10from pathlib import PurePath11 12from dex.command.CommandBase import CommandBase13 14 15class DexDeclareFile(CommandBase):16    def __init__(self, declared_file):17        if not isinstance(declared_file, str):18            raise TypeError("invalid argument type")19 20        # Use PurePath to create a cannonical platform path.21        # TODO: keep paths as PurePath objects for 'longer'22        self.declared_file = str(PurePath(declared_file))23        super(DexDeclareFile, self).__init__()24 25    @staticmethod26    def get_name():27        return __class__.__name__28 29    def eval(self):30        return self.declared_file31