-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
76 lines (61 loc) · 2.2 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
## DosBox APP
# IMPORTS
import random
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.popup import Popup
from kivy.core.clipboard import Clipboard
from kivy.uix.textinput import TextInput
from kivy.uix.scrollview import ScrollView
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.actionbar import ActionBar, ActionView, ActionPrevious
# KIVY Design
with open("main.kv") as kv:
Builder.load_string(kv.read())
# App Class
class DoSBoX(App):
def random_password(self, *args):
words = "a1bc0UVWd4ehi2jklB3CDE6mGop5MNquvwFH8xyzAInJKLOP7fgQRSTXrstY9Z"
Username = "DBuser" + str(random.randint(1000,9999))
Password = "".join(random.choices(words, k=10))
self.Password.text = Password
self.Username.text = Username
self.List += f"[b][color=#FF0000]USER: [color=#AAAAAA]{Username}\n[color=#FF0000]PASS: [color=#AAAAAA]{Password}[/color][/b]\n\n"
self.ScrollView.ids.label.text = self.List
# BUILD FUNCTION
def build(self):
# List
self.List = ""
# root
self.root = FloatLayout(size_hint = (1, 1))
# ActionBar
self.ActionBar = ActionBar()
# Scroll View
self.ScrollView = ScrollView()
self.ScrollView.ids.label.text = ""
# Password
self.Password = TextInput(pos_hint = {"right":0.95, "center_y":0.75})
# Name
self.Username = TextInput(pos_hint = {"right":0.95, "center_y":0.85})
# Button
self.Copy = Button(
pos_hint = {"right":0.95, "center_y":0.07},
text = "Copy",
on_press = lambda _:Clipboard.copy(f"{self.Username.text}:{self.Password.text}")
)
# Add Widgets
self.root.add_widget(self.ActionBar)
self.root.add_widget(self.Username)
self.root.add_widget(self.Password)
self.root.add_widget(self.ScrollView)
self.root.add_widget(self.Copy)
# Clock
Clock.schedule_interval((lambda _:self.random_password(self)), 2)
# RETRUN root
return self.root
# RUN
DoSBoX().run()
# -> END