Skip to content

Commit 1e7bb00

Browse files
committed
Code overhaul
Switched to Tkinter, added syntax highlighter, line numbers, dark theme and more.
1 parent cb516bd commit 1e7bb00

23 files changed

+490
-182
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# amdiff
22

3-
ASCII diff tool written in Python 3 using PyQt<br>
3+
ASCII diff tool written in Python 3<br>
44

5-
pip3 install pyqt5<br>
5+
Supporting Python syntax highlighting
6+
<br>
7+
<br>
8+
Download Windows executable at -
9+
Download macOS executable at -
10+
Linux users can run it with ./bin/amdiff
11+
<br>
12+
Supports command line syntax ./amdiff &lt;file1&gt; &lt;file2&gt;
13+
<br>
614

7-
<img src="https://raw.githubusercontent.com/AlexMartin17/amdiff-ascii-diff-tool/master/img/mainui.JPG">
8-
<img src="https://raw.githubusercontent.com/AlexMartin17/amdiff-ascii-diff-tool/master/img/files.JPG">
9-
<img src="https://raw.githubusercontent.com/AlexMartin17/amdiff-ascii-diff-tool/master/img/differenceui.JPG">
15+
<img src="D:\Alex-Martin\projects\software_engineering\python\amdiff-ascii-diff-tool\img\examples\example_files.JPG">
16+
<img src="D:\Alex-Martin\projects\software_engineering\python\amdiff-ascii-diff-tool\img\examples\example_files2.png">
17+
18+
<img src="D:\Alex-Martin\projects\software_engineering\python\amdiff-ascii-diff-tool\img\examples\gui1.png">
19+
<img src="D:\Alex-Martin\projects\software_engineering\python\amdiff-ascii-diff-tool\img\examples\gui2.png">
20+
<img src="D:\Alex-Martin\projects\software_engineering\python\amdiff-ascii-diff-tool\img\examples\gui3.png">

bin/amdiff

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
python3 ../src/main.py "$@"

bin/win32/amdiff.exe

9.81 MB
Binary file not shown.

config/python.xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<language id="python" name="Python">
3+
<styles>
4+
<style name="self" foreground="#BD11B8" />
5+
<style name="False" foreground="#FF5733" />
6+
<style name="None" foreground="#FF5733" />
7+
<style name="True" foreground="#FF5733" />
8+
<style name="and" foreground="#FF5733" />
9+
<style name="as" foreground="#FF5733" />
10+
<style name="assert" foreground="#FF5733" />
11+
<style name="async" foreground="#FF5733" />
12+
<style name="await" foreground="#FF5733" />
13+
<style name="break" foreground="#FF5733" />
14+
<style name="class" foreground="#FF5733" />
15+
<style name="continue" foreground="#FF5733" />
16+
<style name="def " foreground="#FF5733" />
17+
<style name="del" foreground="#FF5733" />
18+
<style name="elif" foreground="#FF5733" />
19+
<style name="else" foreground="#FF5733" />
20+
<style name="except" foreground="#FF5733" />
21+
<style name="finally" foreground="#FF5733" />
22+
<style name="for" foreground="#FF5733" />
23+
<style name="from" foreground="#FF5733" />
24+
<style name="global" foreground="#FF5733" />
25+
<style name="if" foreground="#FF5733" />
26+
<style name="import" foreground="#FF5733" />
27+
<style name="in" foreground="#FF5733" />
28+
<style name="is" foreground="#FF5733" />
29+
<style name="lambda" foreground="#FF5733" />
30+
<style name="nonlocal" foreground="#FF5733" />
31+
<style name="not" foreground="#FF5733" />
32+
<style name="or" foreground="#FF5733" />
33+
<style name="pass" foreground="#FF5733" />
34+
<style name="raise" foreground="#FF5733" />
35+
<style name="return" foreground="#FF5733" />
36+
<style name="try" foreground="#FF5733" />
37+
<style name="while" foreground="#FF5733" />
38+
<style name="with" foreground="#FF5733" />
39+
<style name="yield" foreground="#FF5733" />
40+
<style name="print" foreground="#FF5733" />
41+
</styles>
42+
</language>

examples/example_code1.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
class Diff:
2+
def __init__(self):
3+
self.root = tk.Tk()
4+
self.root.title("amdiff")
5+
6+
self.window_width = 265
7+
self.window_height = 120
8+
9+
self.screen_width = self.root.winfo_screenwidth()
10+
self.screen_height = self.root.winfo_screenheight()
11+
12+
x = (self.screen_width - self.window_width) // 2
13+
y = (self.screen_height - self.window_height) // 2
14+
15+
self.root.geometry(f"{self.window_width}x{self.window_height}+{int(x)}+{int(y)}")
16+
self.root.resizable(False, False)
17+
18+
self.entry1 = tk.Entry(self.root, width=30)
19+
self.entry1.grid(row=1, column=0, padx=10, pady=10)
20+
self.button1 = tk.Button(self.root, text="File 1", command=lambda: self.browse_file(1))
21+
self.button1.grid(row=1, column=1, padx=10)
22+
23+
self.entry2 = tk.Entry(self.root, width=30)
24+
self.entry2.grid(row=2, column=0, padx=10, pady=10)
25+
self.button2 = tk.Button(self.root, text="File 2", command=lambda: self.browse_file(2))
26+
self.button2.grid(row=2, column=1, padx=10)
27+
28+
self.button3 = tk.Button(self.root, text="Diff", width=10, command=self.diff)
29+
self.button3.grid(row=3, column=0, padx=10)

examples/example_code2.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
class Diff:
2+
def __init__(self):
3+
self.root = tk.Tk()
4+
self.root.title("amdiff")
5+
6+
self.window_width = 265
7+
self.window_height = 120
8+
9+
self.screen_width = self.root.winfo_screenwidth()
10+
self.screen_height = self.root.winfo_screenheight()
11+
12+
x = (self.screen_width - self.window_width) // 2
13+
y = (self.screen_height - self.window_height) // 2
14+
15+
self.root.geometry(f"{self.window_width}x{self.window_height}+{int(x)}+{int(y)}")
16+
self.root.resizable(False, False)
17+
18+
self.entry1 = tk.Entry(self.root, width=30)
19+
self.entry1.grid(row=1, column=0, padx=10, pady=10)
20+
self.button1 = tk.Button(self.root, text="File 1", command=lambda: self.browse_file(1))
21+
22+
self.entry2 = tk.Entry(self.root, width=30)
23+
self.entry2.grid(row=2, column=0, padx=10, pady=10)
24+
self.button2 = tk.Button(self.root, text="File 2", command=lambda: self.browse_file(2))
25+
26+
self.button4 = tk.Button(self.root, text="Diff", width=10, command=self.diff)
27+
self.button4.grid(row=3, column=0, padx=10)
28+
print("Say what?")

examples/example_file1.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Diff tool written in Python3
2+
Examples:
3+
4+
Same line
5+
6+
Modified line
7+
Removed line

examples/example_file2.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Diff tool written in Python3 using Tk
2+
Examples:
3+
4+
Same line
5+
Added line
6+
Modified lInE

examples/examplefile1.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/examplefile2.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

img/apple-icon-57x57.png

3.56 KB
Loading

img/differenceui.JPG

-36 KB
Binary file not shown.

img/examples/example_files.JPG

34.1 KB
Loading

img/examples/example_files2.png

30.6 KB
Loading

img/examples/gui1.png

69.5 KB
Loading

img/examples/gui2.png

81.8 KB
Loading

img/examples/gui3.png

140 KB
Loading

img/favicon.ico

14.7 KB
Binary file not shown.

img/files.JPG

-28.2 KB
Binary file not shown.

img/icon_120x120.png

9.43 KB
Loading

img/mainui.JPG

-17.5 KB
Binary file not shown.

src/diff.py

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)