Skip to content

Commit eb6de8b

Browse files
committed
Add config parser.
1 parent a6f6576 commit eb6de8b

File tree

4 files changed

+14
-29
lines changed

4 files changed

+14
-29
lines changed

.gitattributes

-22
This file was deleted.

.gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
NOTES.txt
55
*.swp
66
*.txt
7-
#*-aon.log
8-
#*-aon.err
7+
*.log
8+
*.err
99
*.pk
1010
.idea*
11-
*~
11+
*~
12+
conf.ini

conf.ini.example

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[options]
2+
server_ip =
3+
search =

parsers/vlt_parser.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
__author__ = 'Maksim Sokolski'
2-
31
import os
42
import pickle
53
import telnetlib
@@ -9,6 +7,7 @@
97

108
from viewer.notify import view_tk
119
from contact.contact import Contact
10+
import configparser
1211

1312

1413
PATH = os.path.dirname(os.path.realpath(__file__)) + '/../log/' +\
@@ -17,8 +16,12 @@
1716
FILE_ERR = PATH + '-aon.err'
1817
FILE_DUMP = os.path.dirname(os.path.realpath(__file__)) + '/../contact/book.pk'
1918

20-
HOST = "192.168.52.6" # Log-server IP-address
21-
STR_SEARCH = '577140400' # Searched phone number
19+
config = configparser.ConfigParser()
20+
config.read(os.path.dirname(os.path.realpath(__file__)) + '/../conf.ini')
21+
22+
23+
HOST = config.get('options', 'server_ip') # Log-server IP-address
24+
STR_SEARCH = config.get('options', 'search') # Searched phone number
2225
TEXT = "Incoming call from "
2326

2427
CONTACTS_LOCK = threading.Lock()

0 commit comments

Comments
 (0)