kopipasta 0.17.0__tar.gz → 0.18.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kopipasta might be problematic. Click here for more details.
- {kopipasta-0.17.0/kopipasta.egg-info → kopipasta-0.18.0}/PKG-INFO +1 -1
- {kopipasta-0.17.0 → kopipasta-0.18.0}/kopipasta/main.py +13 -1
- {kopipasta-0.17.0 → kopipasta-0.18.0/kopipasta.egg-info}/PKG-INFO +1 -1
- {kopipasta-0.17.0 → kopipasta-0.18.0}/requirements.txt +1 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/setup.py +1 -1
- {kopipasta-0.17.0 → kopipasta-0.18.0}/LICENSE +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/MANIFEST.in +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/README.md +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/kopipasta/__init__.py +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/kopipasta.egg-info/SOURCES.txt +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/kopipasta.egg-info/dependency_links.txt +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/kopipasta.egg-info/entry_points.txt +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/kopipasta.egg-info/requires.txt +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/kopipasta.egg-info/top_level.txt +0 -0
- {kopipasta-0.17.0 → kopipasta-0.18.0}/setup.cfg +0 -0
|
@@ -8,11 +8,22 @@ import re
|
|
|
8
8
|
from typing import Dict, List, Optional, Set, Tuple
|
|
9
9
|
import pyperclip
|
|
10
10
|
import fnmatch
|
|
11
|
+
from pygments import highlight
|
|
12
|
+
from pygments.lexers import get_lexer_for_filename, TextLexer
|
|
13
|
+
from pygments.formatters import TerminalFormatter
|
|
14
|
+
import pygments.util
|
|
11
15
|
|
|
12
16
|
import requests
|
|
13
17
|
|
|
14
18
|
FileTuple = Tuple[str, bool, Optional[List[str]], str]
|
|
15
19
|
|
|
20
|
+
def get_colored_code(file_path, code):
|
|
21
|
+
try:
|
|
22
|
+
lexer = get_lexer_for_filename(file_path)
|
|
23
|
+
except pygments.util.ClassNotFound:
|
|
24
|
+
lexer = TextLexer()
|
|
25
|
+
return highlight(code, lexer, TerminalFormatter())
|
|
26
|
+
|
|
16
27
|
def read_gitignore():
|
|
17
28
|
default_ignore_patterns = [
|
|
18
29
|
'.git', 'node_modules', 'venv', '.venv', 'dist', '.idea', '__pycache__',
|
|
@@ -375,7 +386,8 @@ def select_file_patches(file_path):
|
|
|
375
386
|
print(f"\nSelecting patches for {file_path}")
|
|
376
387
|
for index, (chunk_code, start_line, end_line) in enumerate(code_chunks):
|
|
377
388
|
print(f"\nChunk {index + 1} (Lines {start_line + 1}-{end_line}):")
|
|
378
|
-
|
|
389
|
+
colored_chunk = get_colored_code(file_path, chunk_code)
|
|
390
|
+
print(colored_chunk)
|
|
379
391
|
while True:
|
|
380
392
|
choice = input("(y)es include / (n)o skip / (q)uit rest of file? ").lower()
|
|
381
393
|
if choice == 'y':
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="kopipasta",
|
|
8
|
-
version="0.
|
|
8
|
+
version="0.18.0",
|
|
9
9
|
author="Mikko Korpela",
|
|
10
10
|
author_email="mikko.korpela@gmail.com",
|
|
11
11
|
description="A CLI tool to generate prompts with project structure and file contents",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|