diff options
author | Rahul P | 2019-12-30 16:33:54 +0530 |
---|---|---|
committer | GitHub | 2019-12-30 16:33:54 +0530 |
commit | beffaa53fe1be6368f703052e73e0cd13b99d0f8 (patch) | |
tree | ba6b4752925a3bddb74e1ba83dba1dcc9e0e1832 | |
parent | e6c8d6853e303011948bdf5dbcbeac9926bbf117 (diff) | |
parent | b9f819633a2667a6dd4b2e8d5fe785ff1c5a75ca (diff) | |
download | eSim-beffaa53fe1be6368f703052e73e0cd13b99d0f8.tar.gz eSim-beffaa53fe1be6368f703052e73e0cd13b99d0f8.tar.bz2 eSim-beffaa53fe1be6368f703052e73e0cd13b99d0f8.zip |
Merge pull request #127 from rahulp13/master
update installer script, absolute path for fp-lib-table
-rwxr-xr-x | install-eSim.sh | 54 | ||||
-rwxr-xr-x | src/frontEnd/Application.py | 12 |
2 files changed, 40 insertions, 26 deletions
diff --git a/install-eSim.sh b/install-eSim.sh index 948e36f2..bebcf700 100755 --- a/install-eSim.sh +++ b/install-eSim.sh @@ -1,10 +1,9 @@ #!/bin/bash #=============================================================================== -# # FILE: install-eSim.sh # # USAGE: ./install-eSim.sh --install -# or +# OR # ./install-eSim.sh --uninstall # # DESCRIPTION: This is installation/uninstallation script for eSim @@ -15,7 +14,7 @@ # NOTES: --- # AUTHOR: Fahim Khan, Rahul Paknikar, Saurabh Bansode # ORGANIZATION: FOSSEE at IIT Bombay. -# CREATED: Wednesday 26 November 2019 16:14 +# CREATED: Wednesday 18 December 2019 16:14 # REVISION: --- #=============================================================================== @@ -49,14 +48,14 @@ function createConfigFile function installNghdl { - echo "Installing nghdl............" + echo "Installing NGHDL............" unzip nghdl-master.zip mv nghdl-master nghdl cd nghdl/ ./install-nghdl.sh --install if [ $? -ne 0 ];then - echo -e "\n\n\nNghdl ERROR: Error while installing nghdl\n\n" + echo -e "\n\nThere was some error while installing NGHDL\n\n" exit 0 else ngspiceFlag=1 @@ -80,23 +79,37 @@ function addKicadPPA grep -h "^deb.*$kicadppa*" /etc/apt/sources.list.d/* > /dev/null 2>&1 if [ $? -ne 0 ] then - echo "Adding kicad-4 PPA to install latest ghdl version" + echo "Adding KiCad-4 PPA to local apt-repository" sudo add-apt-repository --yes ppa:js-reynaud/kicad-4 sudo apt-get update else - echo "Kicad-4 is available in synaptic" + echo "KiCad-4 is available in synaptic" fi } function installDependency { - echo "Installing Kicad............" + echo "Installing KiCad............" sudo apt-get install -y kicad + if [ $? -ne 0 ]; then + echo -e "\n\n\"KiCad\" couldn't be installed.\nKindly resolve above \"apt-get\" errors and try again." + exit 1 + fi + echo "Installing PyQt4............" sudo apt-get install -y python-qt4 + if [ $? -ne 0 ]; then + echo -e "\n\n\"PyQt4\" dependency couldn't be installed.\nKindly resolve above \"apt-get\" errors and try again." + exit 1 + fi + echo "Installing Matplotlib......." sudo apt-get install -y python-matplotlib + if [ $? -ne 0 ]; then + echo -e "\n\n\"Matplotlib\" dependency couldn't be installed.\nKindly resolve above \"apt-get\" errors and try again." + exit 1 + fi } @@ -114,7 +127,7 @@ function copyKicadLibrary echo "fp-lib-table copied in the directory" sudo cp -r src/.OfflineFiles/TerminalBlock_Altech_AK300-2_P5.00mm.kicad_mod /usr/share/kicad/modules/Connectors_Terminal_Blocks.pretty/ sudo cp -r src/.OfflineFiles/TO-220-3_Vertical.kicad_mod /usr/share/kicad/modules/TO_SOT_Packages_THT.pretty/ - #Copy Kicad library made for eSim + #Copy KiCad library made for eSim sudo cp -r kicadSchematicLibrary/*.lib /usr/share/kicad/library/ sudo cp -r kicadSchematicLibrary/*.dcm /usr/share/kicad/library/ @@ -252,7 +265,7 @@ if [ $option == "--install" ];then exit 0 fi - echo "-----------------eSim installed Successfully-----------------" + echo "-----------------eSim Installed Successfully-----------------" echo "Type \"esim\" in Terminal to launch it" echo "or double click on \"eSim\" icon placed on Desktop" @@ -263,24 +276,27 @@ if [ $option == "--install" ];then elif [ $option == "--uninstall" ];then - echo -n "Are you sure? It will remove complete eSim including KiCad, Ngspice, NGHDL, your subcircuit and model library packages(y/n):" + echo -n "Are you sure? It will remove complete eSim including KiCad, Ngspice, NGHDL and model library packages(y/n):" read getConfirmation if [ $getConfirmation == "y" -o $getConfirmation == "Y" ];then echo "Deleting Files................" sudo rm -rf $HOME/.esim $HOME/.config/kicad $HOME/Desktop/esim.desktop esim-start.sh esim.desktop /usr/bin/esim - echo "Removing Kicad................" + echo "Removing KiCad................" sudo apt-get remove -y kicad echo "Removing NGHDL................" rm -rf src/modelParamXML/Nghdl/* cd nghdl/ - ./install-nghdl.sh --uninstall - cd ../ - rm -rf nghdl - if [ $? -eq 0 ];then - echo "Uninstalled successfully" + ./install-nghdl.sh --uninstall + cd ../ + rm -rf nghdl + if [ $? -eq 0 ];then + echo -e "----------------eSim Uninstalled Successfully----------------" + else + echo -e "\nError while removing some files/directories in \"nghdl\". Please remove it manually" + fi else - echo "Error while removing some file/directory. Please remove it manually" + echo -e "\nCannot find \"nghdl\" directory. Please remove it manually" fi elif [ $getConfirmation == "n" -o $getConfirmation == "N" ];then exit 0 @@ -293,4 +309,4 @@ else echo "Please select the proper operation." echo "--install" echo "--uninstall" -fi
\ No newline at end of file +fi diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index a610a013..808634cc 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -96,8 +96,6 @@ class Application(QtGui.QMainWindow): self.closeproj.setShortcut('Ctrl+X') self.closeproj.triggered.connect(self.close_project) - - for file in os.listdir(os.getenv('HOME') + "/.config/kicad"): if file.startswith("fp-lib-table"): if file.endswith("offline"): @@ -252,6 +250,7 @@ class Application(QtGui.QMainWindow): self.obj_Mainview.obj_projectExplorer.addTreeNode(directory, filelist) except: pass + def help_project(self): print "Function : Help" @@ -260,18 +259,17 @@ class Application(QtGui.QMainWindow): self.obj_Mainview.obj_dockarea.usermanual() - def go_online_offline(self): if not self.obj_kicad.check_open_schematic(): if self.online_flag: - os.rename("../../../../.config/kicad/fp-lib-table", "../../../../.config/kicad/fp-lib-table-online") - os.rename("../../../../.config/kicad/fp-lib-table-offline", "../../../../.config/kicad/fp-lib-table") + os.rename(os.getenv('HOME') + "/.config/kicad/fp-lib-table", os.getenv('HOME') + "/.config/kicad/fp-lib-table-online") + os.rename(os.getenv('HOME') + "/.config/kicad/fp-lib-table-offline", os.getenv('HOME') + "/.config/kicad/fp-lib-table") self.webConnect.setIcon(QtGui.QIcon('../../images/offline.png')) self.webConnect.setText('<b>Go Online</b>') self.online_flag = False else: - os.rename("../../../../.config/kicad/fp-lib-table", "../../../../.config/kicad/fp-lib-table-offline") - os.rename("../../../../.config/kicad/fp-lib-table-online", "../../../../.config/kicad/fp-lib-table") + os.rename(os.getenv('HOME') + "/.config/kicad/fp-lib-table", os.getenv('HOME') + "/.config/kicad/fp-lib-table-offline") + os.rename(os.getenv('HOME') + "/.config/kicad/fp-lib-table-online", os.getenv('HOME') + "/.config/kicad/fp-lib-table") self.webConnect.setIcon(QtGui.QIcon('../../images/online.png')) self.webConnect.setText('<b>Go Offline</b>') self.online_flag = True |