-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwindow.py
More file actions
executable file
·58 lines (49 loc) · 1.76 KB
/
Copy pathwindow.py
File metadata and controls
executable file
·58 lines (49 loc) · 1.76 KB
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
from flask import url_for
class Window:
_instance = None
# def __new__(cls, component):
# if cls._instance is None:
# cls._instance = super(Window, cls).__new__(cls)
# cls.component = component
# return cls._instance
def __init__(self, component, title='Document'):
self.title = title
self.component = component
def __repr__(self) -> str:
return f'''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{self.title}</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="{url_for('static', filename='bridge.js')}"></script>
</head>
<body>
{self.component.__repr__()}
</body>
</html>
'''
def find_element_by_class(self):
return 's'
def writeFile(self):
# self.a = str(pathlib.Path(__file__).parent.absolute()) + '/static/'
# self.f = open("{a}index.html".format(a=self.a), "w+")
# self.f.write(repr(component))
# self.f.close()
return repr(self.component)
# <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
# <script type=text/javascript>
# $(function() {
# $('a#test').on('click', function(e) {
# e.preventDefault()
# $.getJSON('/handleDOM',
# function(data) {
# //do nothing
# });
# return false;
# });
# });
# </script>