-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Stars to skip mail verification
- Loading branch information
Showing
27 changed files
with
1,176 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import configparser | ||
import datetime | ||
import logging | ||
import logging.handlers | ||
import sqlite3 | ||
|
||
if __name__ == "__main__": | ||
config = configparser.ConfigParser() | ||
config.sections() | ||
BOT_CONFIG_FILE = "kindle.conf" | ||
config.read(BOT_CONFIG_FILE) | ||
log_file = config["DEFAULT"]["logfile"] | ||
db = config["SQLITE3"]["data_base"] | ||
table = 'premium' | ||
|
||
LOG_INFO_FILE = log_file | ||
logger_info = logging.getLogger("InfoLogger") | ||
logger_info.setLevel(logging.DEBUG) | ||
handler_info = logging.handlers.RotatingFileHandler( | ||
LOG_INFO_FILE, maxBytes=10240, backupCount=5, encoding="utf-8" | ||
) | ||
logger_info.addHandler(handler_info) | ||
|
||
conn = sqlite3.connect(db) | ||
|
||
cursor = conn.cursor() | ||
|
||
aux = ( | ||
"""CREATE TABLE {} ( | ||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
chatid TEXT NOT NULL, | ||
saldo TEXT); | ||
""" | ||
).format(table) | ||
|
||
aux2 = ('''SELECT * FROM "{}"''').format(table) | ||
|
||
try: | ||
cursor.execute(aux) | ||
logger_info.info( | ||
str(datetime.datetime.now()) + " Tabela usuarios criada" | ||
) | ||
except: | ||
cursor.execute(aux2) | ||
usuarios = cursor.fetchall() | ||
for user in usuarios: | ||
print(user) | ||
pass | ||
|
||
conn.commit() | ||
conn.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.