Skip to content

Commit f6e3bef

Browse files
committed
add
1 parent 8b79601 commit f6e3bef

File tree

10 files changed

+84
-17
lines changed

10 files changed

+84
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
vrequest.egg-info/
12
__pycache__/
23
dist/
34
build/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 cilame
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

setup.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from setuptools import setup
2+
3+
setup(
4+
name = "vrequest",
5+
version = "1.0.0",
6+
7+
keywords = "vrequest",
8+
author = "cilame",
9+
author_email = "[email protected]",
10+
url="https://github.com/cilame/vrequest",
11+
license = "MIT",
12+
description = "",
13+
long_description = '',
14+
long_description_content_type="text/markdown",
15+
classifiers = [
16+
'License :: OSI Approved :: MIT License',
17+
'Programming Language :: Python',
18+
'Intended Audience :: Developers',
19+
],
20+
21+
packages = ["vrequest"],
22+
python_requires=">=3.6",
23+
install_requires=[
24+
'requests',
25+
'lxml',
26+
],
27+
28+
entry_points={
29+
'console_scripts': ['vvv = vrequest.main:execute']
30+
},
31+
)

test/_test_cmdline.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# 增加环境变量,仅测试使用
2+
import os
3+
import sys
4+
p = os.path.split(os.getcwd())[0]
5+
sys.path.append(p)
6+
7+
8+
from vrequest import main
9+
main.execute()

vrequest/combinekey.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import types
22

3-
from root import root
3+
from .root import root
44

55
def bind_ctl_key(func, key=None, shift=False):
66
if key is None:

vrequest/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from tkinter import scrolledtext
99
from tkinter.font import Font
1010

11-
from root import DEFAULTS_HEADERS
11+
from .root import DEFAULTS_HEADERS
1212

1313
Text = scrolledtext.ScrolledText
1414
#Text = tkinter.Text

vrequest/main.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

2-
from root import (
2+
from .root import (
33
root,
44
config,
55
change_siz,
66
)
7-
from menu import bind_menu
8-
from tab import (
7+
from .menu import bind_menu
8+
from .tab import (
99
nb,
1010
bind_frame,
1111
delete_curr_tab,
@@ -22,13 +22,13 @@
2222
get_xpath_elements,
2323
get_auto_xpath,
2424
)
25-
from combinekey import (
25+
from .combinekey import (
2626
bind_ctl_key,
2727
bind_alt_key,
2828
)
2929

3030
# 这里的框架就是目前需要设计处理的图形内容
31-
from frame import (
31+
from .frame import (
3232
helper_window,
3333
request_window,
3434
)
@@ -72,8 +72,13 @@
7272
bind_alt_key(get_auto_xpath, 'f') # 获取路径xpath
7373

7474

75-
root.title('vrequest')
76-
root.geometry(config['siz'])
77-
root.bind('<Configure>',lambda e:change_siz())
78-
root.bind('<Escape>',lambda e:switch_response_log())
79-
root.mainloop()
75+
76+
def execute():
77+
root.title('vrequest')
78+
root.geometry(config['siz'])
79+
root.bind('<Configure>',lambda e:change_siz())
80+
root.bind('<Escape>',lambda e:switch_response_log())
81+
root.mainloop()
82+
83+
if __name__ == '__main__':
84+
execute()

vrequest/menu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import tkinter
22
import types
33

4-
from root import root
4+
from .root import root
55

66
menu = tkinter.Menu(root, tearoff=0)
77

vrequest/tab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
from tkinter import ttk
99
from tkinter.simpledialog import askstring
1010

11-
from root import (
11+
from .root import (
1212
root,
1313
config,
1414
save,
1515
)
16-
from frame import (
16+
from .frame import (
1717
request_window,
1818
response_window,
1919
helper_window,
2020
frame_setting,
2121
)
22-
from util import (
22+
from .util import (
2323
format_url,
2424
format_url_show,
2525
format_url_code,

vrequest/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def post(url,headers{}):
202202
if i.startswith('<normal_content:'):
203203
rt = re.findall('<normal_content:(.*)>', i)[0].strip()
204204
rt = rt if rt else '//html'
205-
from tab import normal_content
205+
from .tab import normal_content
206206
func_code = inspect.getsource(normal_content).strip()
207207
func_code += '\n\ncontent = normal_content(content, rootxpath="{}")'.format(rt)
208208
_format = _format + '\n\n' + func_code

0 commit comments

Comments
 (0)