Skip to content

Commit

Permalink
Merge pull request #128 from felipealfonsog/development
Browse files Browse the repository at this point in the history
Updates in Unstable version
  • Loading branch information
felipealfonsog authored Feb 20, 2024
2 parents 0bf44ac + 2464246 commit ddade6f
Showing 1 changed file with 60 additions and 49 deletions.
109 changes: 60 additions & 49 deletions src/termpdf_unstable.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*************************************************
TermPDF Viewer - view and navigate PDF files within the terminal.
.................................................
This software is licensed under the MIT License.
Released on: 2019-07-31
*************************************************
* Simple: TermPDF Viewer is a Python program that enables users to
view and navigate PDF files directly within the terminal.
Expand Down Expand Up @@ -135,20 +138,66 @@ def display_pdf(pdf_filename):

def display_about():
print("------------------------------------------------------------------")
print("******************************************************************")
print("TermPDF Viewer - view and navigate PDF files within the terminal.")
print("TermPDF Viewer - Credits & License.")
print("------------------------------------------------------------------")
print("* Simple: TermPDF Viewer is a Python program that enables users to ")
print("* view and navigate PDF files directly within the terminal.")
print("*************************************************")
print("------------------------------------------------")
print("* Developed and engineered by:")
print("* Felipe Alfonso Gonzalez <f.alfonso@res-ear.ch>")
print("* Computer Science Engineer")
print("* Chile")
print("*************************************************")
print("------------------------------------------------")
print("* Find me on GitHub: github.com/felipealfonsog")
print("* License: MIT & BSD v3 - Restrictive by author")
print("*************************************************")
print("------------------------------------------------")

def display_faq():
print("* ------------------------------------------------- \n"
"* The TermPDF FAQ & Usage:\n"
"* The TermPDF Viewer will start, allowing you to:\n"
"* -------------------------------------------------\n"
"* Scan for PDF files in the current directory.\n"
"* Select a PDF file to view by entering its number.\n"
"* View the PDF with options to move back, forward, search, or return to the main menu.\n"
"* Quit and return to the main menu.\n"
"* To exit the TermPDF Viewer, use 'q' in the main menu.\n"
"* To search within the PDF, use 's' during viewing and enter the keyword to search.\n"
"* \n"
"* Searching in PDF:\n"
"* \n"
"* Press 's' to initiate a search.\n"
"* Enter the keyword you want to search for when prompted.\n"
"* The matching words in the PDF will be highlighted in red and bold.\n"
"* Options:\n"
"* Press 'b' to go back to the previous page.\n"
"* Press 'f' to go forward to the next page.\n"
"* Press 'q' to exit the search and return to the page where the search began.\n"
"* Press 'enter' to continue the search.\n"
"* Exiting Search:\n"
"* \n"
"* If there are no more matches and you decide to exit the search ('q'), \n"
"* you will return to the page where the search began.\n"
"* You can choose to:\n"
"* Press 'enter' to continue the search.\n"
"* Press 'q' to exit the search and return to the page where the search began.\n"
"* Main Menu:\n"
"* \n"
"* Press '1' to scan for PDF files in the current directory.\n"
"* Press '2' to view scanned PDF files.\n"
"* Press '3' to check the FAQ and Usage.\n"
"* Press '4' to check the LICENCE and CREDITS.\n"
"* Press '5' to quit the TermPDF Viewer.\n"
"* \n"
"-------------------------------------------------------------------------\n"
"* Important Notes:\n"
"* - The application has been tested on Linux and macOS.\n"
"* - For Windows, additional configurations may be required.\n"
"* - Make sure to fulfill the prerequisites before running the application.\n"
"* - For more information, please refer to the project documentation.\n"
"-------------------------------------------------------------------------\n")



def main():
print("\n"
Expand Down Expand Up @@ -179,47 +228,6 @@ def main():
" pip install PyMuPDF\n"
" pip install termcolor\n"
"\n"
"* The TermPDF Viewer will start, allowing you to: \n"
"* Scan for PDF files in the current directory.\n"
"* Select a PDF file to view by entering its number.\n"
"* View the PDF with options to move back, forward, search, or return to the main menu.\n"
"* Quit and return to the main menu.\n"
"* To exit the TermPDF Viewer, use 'q' in the main menu.\n"
"* To search within the PDF, use 's' during viewing and enter the keyword to search.\n"
"* \n"

"* Searching in PDF:\n"
"* \n"
"* Press 's' to initiate a search.\n"
"* Enter the keyword you want to search for when prompted.\n"
"* The matching words in the PDF will be highlighted in red and bold.\n"
"* Options:\n"
"* Press 'b' to go back to the previous page.\n"
"* Press 'f' to go forward to the next page.\n"
"* Press 'q' to exit the search and return to the page where the search began.\n"
"* Press 'enter' to continue the search.\n"
"* Exiting Search:\n"
"* \n"
"* If there are no more matches and you decide to exit the search ('q'), \n"
"* you will return to the page where the search began.\n"
"* You can choose to:\n"
"* Press 'enter' to continue the search.\n"
"* Press 'q' to exit the search and return to the page where the search began.\n"
"* Main Menu:\n"
"* \n"
"* Press '1' to scan for PDF files in the current directory.\n"
"* Press '2' to view scanned PDF files.\n"
"* Press '3' to check the LICENCE and CREDITS.\n"
"* Press '4' to quit the TermPDF Viewer.\n"
"* \n"

"-------------------------------------------------------------------------\n"
"* Important Notes:\n"
"* - The application has been tested on Linux and macOS.\n"
"* - For Windows, additional configurations may be required.\n"
"* - Make sure to fulfill the prerequisites before running the application.\n"
"* - For more information, please refer to the project documentation.\n"
"-------------------------------------------------------------------------\n"
)

print("Welcome to the TermPDF Viewer!")
Expand All @@ -231,8 +239,9 @@ def main():
print("\n----------------------")
print("1. Scan for PDF files")
print("2. View scanned PDF files")
print("3. About - Licence and credits")
print("4. Quit")
print("3. FAQ - Usage")
print("4. About - Licence and credits")
print("5. Quit")

choice = input("Enter the number of your choice: ")

Expand Down Expand Up @@ -267,8 +276,10 @@ def main():
print("Invalid input. Please enter a valid number.")

elif choice == '3':
display_about()
display_faq()
elif choice == '4':
display_about()
elif choice == '5':
print("Goodbye!")
break
else:
Expand Down

0 comments on commit ddade6f

Please sign in to comment.