This repository was archived by the owner on Nov 13, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +52
-3
lines changed Expand file tree Collapse file tree 3 files changed +52
-3
lines changed Original file line number Diff line number Diff line change 1
- import lxml .etree as ET
2
1
import sys
3
2
import os
4
3
from utils import getTabs
5
4
from parsing import ModuleParser
5
+ import platform
6
+ try :
7
+ import lxml .etree as ET
8
+ except ImportError :
9
+ platform_type = platform .system ()
10
+ if platform_type in ["Darwin" , "Windows" ]:
11
+ print ("Install lxml using:" )
12
+ print ("\t pip install lxml" )
13
+ print ("\t or" )
14
+ print ("\t pip3 install lxml" )
15
+ exit ()
16
+ elif platform_type == "Linux" :
17
+ print ("Install lxml using:" )
18
+ print ("\t sudo apt install python-lxml" )
19
+ print ("\t or" )
20
+ print ("\t sudo apt install python3-lxml" )
21
+ exit ()
6
22
7
23
class ModuleCompiler :
8
24
def processSubProperty (self , prop , generic ):
Original file line number Diff line number Diff line change 1
- import lxml .etree as ET
2
1
import sys
3
2
import json
4
3
import re
5
4
import os
6
5
from classes import *
6
+ import platform
7
+ try :
8
+ import lxml .etree as ET
9
+ except ImportError :
10
+ platform_type = platform .system ()
11
+ if platform_type in ["Darwin" , "Windows" ]:
12
+ print ("Install lxml using:" )
13
+ print ("\t pip install lxml" )
14
+ print ("\t or" )
15
+ print ("\t pip3 install lxml" )
16
+ exit ()
17
+ elif platform_type == "Linux" :
18
+ print ("Install lxml using:" )
19
+ print ("\t sudo apt install python-lxml" )
20
+ print ("\t or" )
21
+ print ("\t sudo apt install python3-lxml" )
22
+ exit ()
7
23
8
24
class ModuleParser :
9
25
Original file line number Diff line number Diff line change 1
- import lxml .etree as ET
2
1
import sys
3
2
import os
4
3
from utils import getTabs
5
4
from parsing import ModuleParser
5
+ import platform
6
+ try :
7
+ import lxml .etree as ET
8
+ except ImportError :
9
+ platform_type = platform .system ()
10
+ if platform_type in ["Darwin" , "Windows" ]:
11
+ print ("Install lxml using:" )
12
+ print ("\t pip install lxml" )
13
+ print ("\t or" )
14
+ print ("\t pip3 install lxml" )
15
+ exit ()
16
+ elif platform_type == "Linux" :
17
+ print ("Install lxml using:" )
18
+ print ("\t sudo apt install python-lxml" )
19
+ print ("\t or" )
20
+ print ("\t sudo apt install python3-lxml" )
21
+ exit ()
22
+
6
23
7
24
class ModulePrinter :
8
25
# shorthand for printing single and list values
You can’t perform that action at this time.
0 commit comments