@ -38,8 +38,7 @@ Additionally, there is a [Discord Server](https://discord.gg/swqtb7AsNQ) for any
## I Want To Contribute
### Reporting Bugs
#### Before Submitting a Bug Report
<details><summary><h4>Before Submitting a Bug Report</h4></summary>
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
@ -53,8 +52,8 @@ A good bug report shouldn't leave others needing to chase you up for more inform
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
- Your input and the output
- Is the issue reproducable? Does it exist in previous versions?
#### How Do I Submit a Good Bug Report?
</details>
<details><summary><h4>How Do I Submit a Good Bug Report?</h4></summary>
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
@ -68,12 +67,13 @@ Once it's filed:
- The project team will label the issue accordingly.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will try to support you as best as they can, but you may not recieve an instant.
- If the team discovers that this is an issue it will be marked `bug` or `error`, as well as possibly other tags relating to the nature of the error), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
</details>
### Suggesting Enhancements
This section guides you through submitting an enhancement suggestion for Reddit Video Maker Bot, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
#### Before Submitting an Enhancement
<details><summary><h4>Before Submitting an Enhancement</h4></summary>
- Make sure that you are using the latest version.
- Read the [documentation](https://luka-hietala.gitbook.io/documentation-for-the-reddit-bot/) carefully and find out if the functionality is already covered, maybe by an individual configuration.
@ -90,6 +90,8 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/elebum
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
- **Explain why this enhancement would be useful** to most users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
console.log("[red]Setup was already completed! Please make sure you have to run this script again. If you have to, please delete the file .setup-done-before")
defhandle_input(
message:str="",
check_type=False,
match:str="",
err_message:str="",
nmin=None,
nmax=None,
oob_error="",
):
match=re.compile(match+"$")
whileTrue:
user_input=input(message+"\n> ").strip()
ifre.match(match,user_input)isnotNone:
ifcheck_typeisnotFalse:
try:
user_input=check_type(user_input)
ifnminisnotNoneanduser_input<nmin:
console.log("[red]"+oob_error)# Input too low failstate
continue
ifnmaxisnotNoneanduser_input>nmax:
console.log("[red]"+oob_error)# Input too high
continue
break# Successful type conversion and number in bounds
exceptValueError:
console.log("[red]"+err_message)# Type conversion failed
continue
if(
nminisnotNoneandlen(user_input)<nmin
):# Check if string is long enough
console.log("[red]"+oob_error)
continue
if(
nmaxisnotNoneandlen(user_input)>nmax
):# Check if string is not too long
console.log("[red]"+oob_error)
continue
break
console.log("[red]"+err_message)
returnuser_input
ifos.path.isfile(".setup-done-before"):
console.log(
"[red]Setup was already completed! Please make sure you have to run this script again. If that is such, delete the file .setup-done-before"
)
exit()
# These lines ensure the user:
@ -26,30 +67,32 @@ if setup_done == True:
# - knows that they are about to erase any other setup files/data.
print_step("Setup Assistant")
print_markdown(
"### You're in the setup wizard. Ensure you're supposed to be here, then type yes to continue. If you're not sure, type no to quit."
)
# This Input is used to ensure the user is sure they want to continue.
ensureSetupIsRequired=input("Are you sure you want to continue? > ").casefold()
ifensureSetupIsRequired!="yes":
ifinput("Are you sure you want to continue? > ").strip().casefold()!="yes":
console.print("[red]Exiting...")
time.sleep(0.5)
exit()
else:
# Again, let them know they are about to erase all other setup data.
console.print("[bold red] This will overwrite your current settings. Are you sure you want to continue? [bold green]yes/no")
overwriteSettings=input("Are you sure you want to continue? > ").casefold()
ifoverwriteSettings!="yes":
# This code is inaccessible if the prior check fails, and thus an else statement is unnecessary
# Again, let them know they are about to erase all other setup data.
console.print(
"[bold red] This will overwrite your current settings. Are you sure you want to continue? [bold green]yes/no"
)
ifinput("Are you sure you want to continue? > ").strip().casefold()!="yes":
console.print("[red]Abort mission! Exiting...")
time.sleep(0.5)
exit()
else:
# Once they confirm, move on with the script.
console.print("[bold green]Alright! Let's get started!")
time.sleep(1)
# This is once again inaccessible if the prior checks fail
# Once they confirm, move on with the script.
console.print("[bold green]Alright! Let's get started!")
print("\n")
console.log("Ensure you have the following ready to enter:")
console.log("[bold green]Reddit Client ID")
console.log("[bold green]Reddit Client Secret")
@ -59,64 +102,108 @@ console.log("[bold green]Reddit 2FA (yes or no)")
console.log("[bold green]Opacity (range of 0-1, decimals are OK)")
console.log("[bold green]Subreddit (without r/ or /r/)")
console.log("[bold green]Theme (light or dark)")
time.sleep(0.5)
console.print("[green]If you don't have these, please follow the instructions in the README.md file to set them up.")
console.print("[green]If you do have these, type yes to continue. If you dont, go ahead and grab those quickly and come back.")
confirmUserHasCredentials=input("Are you sure you have the credentials? > ").casefold()
ifconfirmUserHasCredentials!="yes":
console.print(
"[green]If you don't have these, please follow the instructions in the README.md file to set them up."
)
console.print(
"[green]If you do have these, type yes to continue. If you dont, go ahead and grab those quickly and come back."
)
print()
ifinput("Are you sure you have the credentials? > ").strip().casefold()!="yes":
console.print("[red]I don't understand that.")
console.print("[red]Exiting...")
exit()
else:
console.print("[bold green]Alright! Let's get started!")
time.sleep(1)
"""
Begin thesetupprocess.
console.print("[bold green]Alright! Let's get started!")
"""
# Begin the setup process.
console.log("Enter your credentials now.")
cliID=input("Client ID > ")
cliSec=input("Client Secret > ")
user=input("Username > ")
passw=input("Password > ")
twofactor=input("2fa Enabled? (yes/no) > ")
opacity=input("Opacity? (range of 0-1) > ")
subreddit=input("Subreddit (without r/) > ")
theme=input("Theme? (light or dark) > ")
console.log("Attempting to save your credentials...")