diff --git a/Executable/setup.py b/Executable/setup.py new file mode 100644 index 0000000..8e673ce --- /dev/null +++ b/Executable/setup.py @@ -0,0 +1,5 @@ +# setup.py +from distutils.core import setup +import py2exe + +setup(windows=['ListGen.pyw']) diff --git a/Installer/LICENSE b/Installer/LICENSE new file mode 100644 index 0000000..d01d4a1 --- /dev/null +++ b/Installer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Parry Pardun + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Installer/ListGen Setup.iss b/Installer/ListGen Setup.iss new file mode 100644 index 0000000..be31e0d --- /dev/null +++ b/Installer/ListGen Setup.iss @@ -0,0 +1,38 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{EA7EA0EA-3792-45AF-BC1A-636C44900442} +AppName=ListGen +AppVersion=1.0 +;AppVerName=ListGen 1.0 +AppPublisher=Parry Pardun +AppPublisherURL=https://github.com/pjpardun/listgen +AppSupportURL=https://github.com/pjpardun/listgen +AppUpdatesURL=https://github.com/pjpardun/listgen +DefaultDirName={pf}\ListGen +DisableProgramGroupPage=yes +LicenseFile=C:\Python projects\ListGen\Releases\LICENSE +OutputBaseFilename=ListGen 1.0 Setup +SetupIconFile=C:\Python projects\ListGen\Releases\list.ico +Compression=lzma +SolidCompression=yes + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "C:\Python projects\ListGen\Source\EXE\dist\ListGen 1.0.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Python projects\ListGen\Source\EXE\dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{commonprograms}\ListGen"; Filename: "{app}\ListGen 1.0.exe"; IconFilename: "{app}\list.ico" +Name: "{commondesktop}\ListGen"; Filename: "{app}\ListGen 1.0.exe"; Tasks: desktopicon; IconFilename: "{app}\list.ico" + diff --git a/Installer/list.ico b/Installer/list.ico new file mode 100644 index 0000000..516d4bf Binary files /dev/null and b/Installer/list.ico differ diff --git a/ListGen.pyw b/ListGen.pyw new file mode 100644 index 0000000..f00ef39 --- /dev/null +++ b/ListGen.pyw @@ -0,0 +1,115 @@ +# Python 3.6.4 +import tkinter as tk +from tkinter import ttk +import os + + +window = tk.Tk() +window.iconbitmap(os.path.abspath('./list.ico')) +window.title('ListGen 1.0') +window.resizable(0,0) + + +#functions +def convert_delim(): + text2.delete('1.0',tk.END) + varget1 = combovar1.get() + + if varget1 == ',': + rtext = ',' + elif varget1 == ';': + rtext = ';' + elif varget1 == '|': + rtext = ';' + + input = text1.get('1.0',tk.END) + output = input.replace('\n',rtext) + output = output[:-1] + if output.endswith(rtext): + output = output[:-1] + text2.insert(tk.END,output) + + +def convert_line(): + text1.delete('1.0',tk.END) + varget1 = combovar1.get() + + if varget1 == ',': + rtext = ',' + elif varget1 == ';': + rtext = ';' + elif varget1 == '|': + rtext = ';' + + + input = text2.get('1.0',tk.END) + output = input.replace(rtext,'\n') + output = output[:-1] + if output.endswith('\n'): + output = output[:-1] + text1.insert(tk.END,output) + + +def clearall(): + text1.delete('1.0',tk.END) + text2.delete('1.0',tk.END) + + +def copy_text1(): + input = text1.get('1.0',tk.END) + window.clipboard_clear() + window.clipboard_append(input) + + +def copy_text2(): + input = text2.get('1.0',tk.END) + window.clipboard_clear() + window.clipboard_append(input) + +# input dropdown and label +label1 = tk.Label(text='Column Data:',font=("Arial",10)).grid(column=0,row=0,sticky='W',padx=10,pady=10) +text1 = tk.Text(window,height=20,width=20) +text1.grid(column=0,row=1,rowspan=20,padx=10,pady=10) +scrollbar1 = tk.Scrollbar(window, orient='vertical') +scrollbar1.grid(column=0,row=1,rowspan=20,sticky='N'+'S'+'E',padx=10,pady=10) +scrollbar1.config( command = text1.yview ) +text1.configure(yscrollcommand=scrollbar1.set) + +combovar1 = tk.StringVar() +combovar1.set(',') +comboval1 = [',', ';', '|'] +combo1 = ttk.Combobox(window,textvariable=combovar1,values=comboval1,state='readonly',font=('Arial','10'), justify='center',width=7).grid(column=1,row=9,padx=10,pady=10,sticky='W'+'E') + +right = tk.PhotoImage(file=os.path.abspath('./right.png')) +button1 = tk.Button(window, image=right, border=0, cursor='hand2',command=convert_delim).grid(column=1,row=10,sticky='W'+'E',pady=10,padx=10) + +left = tk.PhotoImage(file=os.path.abspath('./left.png')) +button2 = tk.Button(window, image=left, border=0, cursor='hand2',command=convert_line).grid(column=1,row=11,sticky='W'+'E',pady=10,padx=10) + +clear = tk.PhotoImage(file=os.path.abspath('./clear.png')) +button3 = tk.Button(window, image=clear, border=0, cursor='hand2',command=clearall).grid(column=1,row=12,sticky='W'+'E',pady=10,padx=10) + + + +label2 = tk.Label(text='Delimited Data:',font=('Arial',10)).grid(column=2,row=0,sticky='W',padx=10,pady=10) +text2 = tk.Text(window,height=20) +text2.grid(column=2,row=1,rowspan=20,padx=10,pady=10) +scrollbar2 = tk.Scrollbar(window, orient='vertical') +scrollbar2.grid(column=2,row=1,rowspan=20,sticky='N'+'S'+'E',padx=10,pady=10) +scrollbar2.config( command = text2.yview ) +text2.configure(yscrollcommand=scrollbar2.set) + + +clip = tk.PhotoImage(file=os.path.abspath('./clipboard.png')) +button4 = tk.Button(window, image=clip, border=0, cursor='hand2',command=copy_text1).grid(column=0,row=21,sticky='E',padx=10) +button5 = tk.Button(window, image=clip, border=0, cursor='hand2',command=copy_text2).grid(column=2,row=21,sticky='E',padx=10) + + + +label8 = tk.Label(text="© 2018 Parry Pardun",font=("Arial",8)).grid(column=0,row=22,sticky='W'+'S') + +window.update_idletasks() +window.deiconify() +window.mainloop() + + diff --git a/clear.png b/clear.png new file mode 100644 index 0000000..5ef660c Binary files /dev/null and b/clear.png differ diff --git a/clipboard.png b/clipboard.png new file mode 100644 index 0000000..de0b8fe Binary files /dev/null and b/clipboard.png differ diff --git a/left.png b/left.png new file mode 100644 index 0000000..9a78abb Binary files /dev/null and b/left.png differ diff --git a/list.ico b/list.ico new file mode 100644 index 0000000..516d4bf Binary files /dev/null and b/list.ico differ diff --git a/right.png b/right.png new file mode 100644 index 0000000..2b2ed8e Binary files /dev/null and b/right.png differ