Пример #1
0
 def get_temp_dir(self):
     if self.rep_type == Constants.REPOSITORY_TYPE_GIT:
         return FileUtil.normalize_path(
             os.path.join(FileUtil.get_current_dir(), Constants.TEMP_DIR,
                          self.get_temp_dir_name()))
     elif self.rep_type == Constants.REPOSITORY_TYPE_LOCAL:
         return FileUtil.normalize_path(self.rep_path)
     elif self.rep_type == Constants.REPOSITORY_TYPE_ZIP:
         return FileUtil.normalize_path(
             os.path.join(FileUtil.get_current_dir(), Constants.TEMP_DIR,
                          self.get_temp_dir_name()))
     elif self.rep_type == Constants.REPOSITORY_TYPE_TAR:
         return FileUtil.normalize_path(
             os.path.join(FileUtil.get_current_dir(), Constants.TEMP_DIR,
                          self.get_temp_dir_name()))
     else:
         return ''
Пример #2
0
 def get_source_dir(self):
     if self.rep_type == Constants.REPOSITORY_TYPE_GIT:
         return FileUtil.normalize_path(
             os.path.join(FileUtil.get_current_dir(), Constants.VENDOR_DIR,
                          self.get_dir_name()))
     elif self.rep_type == Constants.REPOSITORY_TYPE_LOCAL:
         return FileUtil.normalize_path(os.path.join(
             self.rep_path, 'build'))
     elif self.rep_type == Constants.REPOSITORY_TYPE_ZIP:
         return FileUtil.normalize_path(
             os.path.join(FileUtil.get_current_dir(), Constants.VENDOR_DIR,
                          self.get_dir_name()))
     elif self.rep_type == Constants.REPOSITORY_TYPE_TAR:
         return FileUtil.normalize_path(
             os.path.join(FileUtil.get_current_dir(), Constants.VENDOR_DIR,
                          self.get_dir_name()))
     else:
         return ''
Пример #3
0
    def reset(self):
        self.project_name = ''
        self.project_home_dir = FileUtil.normalize_path(
            FileUtil.get_current_dir())

        self.target_temp_dir = ''
        self.target_source_dir = ''
        self.target_vendor_dir = ''
        self.target_build_dir = ''
        self.target_name = ''

        self.dependency_temp_dir = ''
        self.dependency_source_dir = ''
        self.dependency_vendor_dir = ''
        self.dependency_build_dir = ''
        self.dependency_name = ''

        self.temp_dir = FileUtil.normalize_path(
            os.path.join(self.project_home_dir, Constants.TEMP_DIR))
        self.build_dir = FileUtil.normalize_path(
            os.path.join(self.project_home_dir, Constants.BUILD_DIR))
        self.vendor_dir = FileUtil.normalize_path(
            os.path.join(self.project_home_dir, Constants.VENDOR_DIR))
Пример #4
0
    def test_normalize_path(self):
        normalized = FileUtil.normalize_path('C:\\ezored\\Test')
        expected = 'C:/ezored/Test'

        self.assertEqual(normalized, expected)