Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JewishLewish committed Nov 14, 2023
2 parents b0d4162 + 18f10a7 commit 3cff214
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 44 deletions.
39 changes: 1 addition & 38 deletions concurrency.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,12 @@
from threadedreturn import ThreadWithReturnValue
from threading import Thread

'''
concurrency.py
Code here is designed to speed up certain processes that might take too long
ThreadWithReturnValue is used on functions that returns a certain variable
'''
class ThreadWithReturnValue(Thread):
def __init__(self, group=None, target=None, name=None,
args=(), kwargs={}, Verbose=None):
"""
Initialize a ThreadWithReturnValue instance.
Parameters:
- group: Thread group (not commonly used, defaults to None).
- target: The callable object to be invoked when the thread starts.
- name: The thread name.
- args: A tuple of positional arguments to pass to the target function.
- kwargs: A dictionary of keyword arguments to pass to the target function.
- Verbose: Verbose level (not commonly used, defaults to None).
"""
Thread.__init__(self, group, target, name, args, kwargs)
self._return = None

def run(self):
"""
Override the run method to execute the target function and store its return value.
"""
if self._target is not None:
self._return = self._target(*self._args,
**self._kwargs)
def join(self, *args):
"""
Override the join method to return the stored return value after joining the thread.
Parameters:
- args: Additional arguments to pass to the join method (not commonly used).
Returns:
- object: The return value of the target function executed by the thread.
"""
Thread.join(self, *args)
return self._return

def cloudf_doms(DOMAINS, CLOUDFLARE) -> list:
"""
Retrieve all subdomains for a list of domains using Cloudflare API.
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from data_sql import *
from discord import get_github_username, send_discord_message
from concurrency import *

from threadedreturn import ThreadWithReturnValue
#Sql Wrapper
database = dataSQL(dbfile="database.db")
#Flask App
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Flask==3.0.0
Requests==2.31.0
GitHub-Flask
authlib
authlib
threadedreturn
28 changes: 24 additions & 4 deletions static/styles/claim.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,31 @@ body {
width: 100%;
top: 0;
}

.navbar-nav {
justify-content: center;
margin-left:530px;
text-align: center;
margin-left: 0;
gap: 10px;
padding: 10px;
margin-left: 510px;
}

.nav-link {
color: white !important;
position: relative;
transition: all 0.3s ease-in-out;
padding: 10px 15px;
text-align: center;
display: block;
}

.nav-link::after {
content: '';
position: absolute;
bottom: -2px;
left: 0;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 2px;
background-color: white;
Expand All @@ -60,4 +70,14 @@ body {
.nav-link:hover::after,
.nav-link:focus::after {
width: 100%;
}
}

@media (max-width: 768px) {
.navbar-nav {
justify-content: space-around;
text-align: center;
margin-left: 0;
gap: 10px;
padding: 10px;
}
}
6 changes: 6 additions & 0 deletions templates/claim.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
</form>
</div>
<script src="static/styles/bootstrap/js/bootstrap.min.js"></script>
<script>
document.getElementById('navbar-toggler').addEventListener('click', function () {
var navbarNav = document.querySelector('.navbar-collapse');
navbarNav.classList.toggle('show');
});
</script>
</body>

</html>

0 comments on commit 3cff214

Please sign in to comment.