Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Add files via upload (#14)
Browse files Browse the repository at this point in the history
### Description

<!-- Describe your changes in detail -->

### Motivation & Context

<!-- Why is this change required? What problem does it solve? -->

### Type of changes

<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply. -->

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Refactoring (non-breaking change)
- [x] Breaking change (fix or feature that would change existing
functionality)

### Checklist

<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [x] I have read the [contributing
guidelines](https://github.com/DefinetlyNotAI/Test-generator/blob/main/CONTRIBUTING.md)
- [x] My change introduces changes to the documentation
- [x] I have added tests to cover my changes
- [x] All new and existing tests passed

### Related issues

<!-- Please link any related issues here. -->
  • Loading branch information
DefinetlyNotAI authored Aug 19, 2024
2 parents a78624b + 971c1b5 commit 64dc288
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions DataBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,27 @@
import random
import re
import sqlite3
import subprocess
import hashlib
import os
import time
import colorlog
import pandas as pd
import datetime as dt
from datetime import datetime


class SQL:
def __init__(self, db_name="Users.db"):
def __init__(self, database_name="Users.db"):
"""
Initializes the SQL class.
Args:
db_name (str, optional): The name of the database. Defaults to "Users.db".
database_name (str, optional): The name of the database. Defaults to "Users.db".
"""
# Set the database name
self.db_name = db_name

self.db_name = database_name
if not os.path.exists(self.db_name):
self.create_db()
# Initialize the connection and cursor to None
self.conn = None
self.cursor = None
Expand Down Expand Up @@ -481,8 +484,8 @@ def __timestamp() -> str:
str: The current timestamp.
"""
now = datetime.now()
time = f"{now.strftime('%Y-%m-%d %H:%M:%S')}"
return time.encode('utf-8').decode('utf-8')
timestamped = f"{now.strftime('%Y-%m-%d %H:%M:%S')}"
return timestamped.encode('utf-8').decode('utf-8')

def __only(self, message):
"""
Expand Down Expand Up @@ -591,6 +594,7 @@ def critical(self, message):
)



class DATABASE:
def __init__(self):
"""
Expand Down Expand Up @@ -1222,7 +1226,6 @@ def api(self):

if __name__ == "__main__":
db_name = "Users.db"
sql = SQL(db_name=db_name)
sql = SQL(database_name=db_name)
log = LOG(filename="DataBase.log")
sql.create_db()
DATABASE().api()

0 comments on commit 64dc288

Please sign in to comment.