Skip to content

Commit 67b9459

Browse files
committed
Refactor sys.path.append related code
1 parent 15a5848 commit 67b9459

3 files changed

Lines changed: 11 additions & 16 deletions

File tree

__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
#!/usr/bin/python
2-
# -*- coding: utf-8 -*-
3-
4-
import os
5-
import sys
6-
7-
sd = os.path.abspath(os.path.dirname(__file__))
8-
sys.path.append(sd)

core/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
#!/usr/bin/python
2-
# -*- coding: utf-8 -*-
3-
4-
import os
5-
import sys
6-
7-
sd = os.path.abspath(os.path.dirname(__file__))
8-
sys.path.append(sd)

template/server.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/usr/bin/python
22
# -*- coding: utf-8 -*-
33

4+
import sys
5+
import os
6+
import pathlib
7+
8+
9+
root_path = pathlib.Path(os.path.abspath(__file__)).parent
10+
sys.path.append(str(root_path))
11+
working_path = pathlib.Path(root_path, 'drucker')
12+
sys.path.append(str(working_path))
13+
14+
415
from concurrent import futures
516
import grpc
617
import drucker_pb2_grpc

0 commit comments

Comments
 (0)