Exemple #1
0
 def _print_status(self):
     """Print formatted fork status"""
     if not os.path.isdir(os.path.join(self.path, '.git')):
         cprint(self.name, 'green')
         return
     project_output = format_project_string(self.path, self.name)
     current_ref_output = format_ref_string(self.path)
     print(project_output + ' ' + current_ref_output)
Exemple #2
0
 def _print_status(self):
     """Print formatted project status"""
     repo_path = os.path.join(self.root_directory, self.path)
     if not os.path.isdir(os.path.join(repo_path, '.git')):
         cprint(self.name, 'green')
         return
     project_output = format_project_string(repo_path, self.name)
     current_ref_output = format_ref_string(repo_path)
     path_output = colored(self.path, 'cyan')
     print(project_output + ' ' + current_ref_output + ' ' + path_output)
 def print_status(self):
     """Print clowder repo status"""
     repo_path = os.path.join(self.root_directory, 'clowder')
     cat_face = emoji.emojize(':cat:', use_aliases=True)
     if not os.path.isdir(os.path.join(repo_path, '.git')):
         output = colored('clowder', 'green')
         print(cat_face + '  ' + output)
         return
     project_output = format_project_string(repo_path, 'clowder')
     current_ref_output = format_ref_string(repo_path)
     print(cat_face + '  ' + project_output + ' ' + current_ref_output)
Exemple #4
0
 def _print_status(self):
     """Print formatted project status"""
     repo_path = os.path.join(self.root_directory, self.path)
     if not os.path.isdir(os.path.join(repo_path, '.git')):
         cprint(self.name, 'green')
         return
     project_output = format_project_string(repo_path, self.name)
     current_ref_output = format_ref_string(repo_path)
     path_output = colored(self.path, 'cyan')
     long_output = project_output + ' ' + current_ref_output + ' -> ' + path_output
     short_output = project_output + ' ' + current_ref_output + '\n-> ' + path_output
     long_output_length = len(''.join(s for s in long_output if ord(s) > 31 and ord(s) < 126))
     try:
         ts = os.get_terminal_size()
         if long_output_length <= ts.columns:
             print(long_output)
         else:
             print(short_output)
     except:
         print(short_output)
Exemple #5
0
    def print_status(self):
        """Print clowder repo status"""
        repo_path = os.path.join(self.root_directory, '.clowder')
        # FIXME: Probably should remove this as it assumes .clowder repo which isn't git directory
        if not os.path.isdir(os.path.join(repo_path, '.git')):
            output = colored('.clowder', 'green')
            print(output)
            return
        print(' - Fetching upstream changes for clowder repo', end="", flush=True)
        timer = RepeatedTimer(1, _print_progress)
        git_fetch(self.clowder_path)
        timer.stop()
        print("\n")
        project_output = format_project_string(repo_path, '.clowder')
        current_ref_output = format_ref_string(repo_path)

        clowder_symlink = os.path.join(self.root_directory, 'clowder.yaml')
        if os.path.islink(clowder_symlink):
            real_path = os.path.realpath(clowder_symlink)
            clowder_path = remove_prefix(real_path + '/', self.root_directory)
            path_output = colored(clowder_path[1:-1], 'cyan')
            print(project_output + ' ' + current_ref_output + ' ~~> ' + path_output)
        else:
            print(project_output + ' ' + current_ref_output)