File tree Expand file tree Collapse file tree 2 files changed +36
-15
lines changed
Expand file tree Collapse file tree 2 files changed +36
-15
lines changed Original file line number Diff line number Diff line change 1212import struct
1313import subprocess
1414import uuid
15- from helpers import (
16- is_safe_path ,
17- send_device_description ,
18- send_scpd_xml ,
19- handle_get_protocol_info ,
20- parse_avi_duration ,
21- parse_mp4_duration ,
22- create_directory_mapping ,
23- )
15+
16+ try :
17+ from .helpers import (
18+ is_safe_path ,
19+ send_device_description ,
20+ send_scpd_xml ,
21+ handle_get_protocol_info ,
22+ parse_avi_duration ,
23+ parse_mp4_duration ,
24+ create_directory_mapping ,
25+ )
26+ from http .server import BaseHTTPRequestHandler
27+ from urllib .parse import unquote , urlparse , quote
28+ except ImportError :
29+ from helpers import (
30+ is_safe_path ,
31+ send_device_description ,
32+ send_scpd_xml ,
33+ handle_get_protocol_info ,
34+ parse_avi_duration ,
35+ parse_mp4_duration ,
36+ create_directory_mapping ,
37+ )
2438from http .server import BaseHTTPRequestHandler
2539from urllib .parse import unquote , urlparse , quote
2640
Original file line number Diff line number Diff line change 11import os
22import struct
33import traceback
4- from constants import (
5- SERVER_MANUFACTURER ,
6- SERVER_VERSION ,
7- SERVER_AGENT ,
8- is_supported_media_file ,
9- )
4+
5+ try :
6+ from .constants import (
7+ SERVER_MANUFACTURER ,
8+ SERVER_VERSION ,
9+ SERVER_AGENT ,
10+ )
11+ except ImportError :
12+ from constants import (
13+ SERVER_MANUFACTURER ,
14+ SERVER_VERSION ,
15+ SERVER_AGENT ,
16+ )
1017
1118
1219def is_safe_path (base_dir , requested_path ):
You can’t perform that action at this time.
0 commit comments