mirror of
https://github.com/bspeice/metrik
synced 2024-11-04 22:48:11 -05:00
Didn't think 2.7/3.x compatibility would be this bad...
This commit is contained in:
parent
f9caa2555a
commit
52eaa4b663
19
.idea/inspectionProfiles/Project_Default.xml
Normal file
19
.idea/inspectionProfiles/Project_Default.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ourVersions">
|
||||
<value>
|
||||
<list size="6">
|
||||
<item index="0" class="java.lang.String" itemvalue="2.7" />
|
||||
<item index="1" class="java.lang.String" itemvalue="3.1" />
|
||||
<item index="2" class="java.lang.String" itemvalue="3.2" />
|
||||
<item index="3" class="java.lang.String" itemvalue="3.3" />
|
||||
<item index="4" class="java.lang.String" itemvalue="3.4" />
|
||||
<item index="5" class="java.lang.String" itemvalue="3.5" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
7
.idea/inspectionProfiles/profiles_settings.xml
Normal file
7
.idea/inspectionProfiles/profiles_settings.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="PROJECT_PROFILE" value="Project Default" />
|
||||
<option name="USE_PROJECT_PROFILE" value="true" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
@ -48,7 +48,10 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="true" assert-keyword="false" jdk-15="false" project-jdk-name="Python 3.5.1+ (/usr/bin/python3)" project-jdk-type="Python SDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_3" default="false" assert-keyword="false" jdk-15="false" project-jdk-name="Python 2.7.12 (/usr/bin/python2)" project-jdk-type="Python SDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="PythonCompatibilityInspectionAdvertiser">
|
||||
<option name="version" value="1" />
|
||||
</component>
|
||||
</project>
|
@ -2,15 +2,11 @@ import requests
|
||||
from luigi import Task, Parameter
|
||||
from pyquery import PyQuery as pq
|
||||
import logging
|
||||
|
||||
try:
|
||||
from urllib.parse import quote_plus
|
||||
from html.parser import HTMLParser
|
||||
except ImportError:
|
||||
# noinspection PyUnresolvedReferences
|
||||
from urllib import quote_plus
|
||||
# noinspection PyUnresolvedReferences
|
||||
from HTMLParser import HTMLParser
|
||||
# noinspection PyUnresolvedReferences
|
||||
from six.moves.urllib.parse import quote_plus
|
||||
# noinspection PyUnresolvedReferences
|
||||
from six.moves.html_parser import HTMLParser
|
||||
from six import PY2
|
||||
|
||||
|
||||
class BloombergEquityInfo(Task):
|
||||
@ -20,15 +16,11 @@ class BloombergEquityInfo(Task):
|
||||
@staticmethod
|
||||
def retrieve_info(bbg_code, user_agent):
|
||||
class EquityInfoParser(HTMLParser):
|
||||
|
||||
def __init__(self, keys):
|
||||
# This call isn't safe because python 2 HTMLParser is an
|
||||
# old-style class
|
||||
try:
|
||||
if PY2:
|
||||
HTMLParser.__init__(self)
|
||||
else:
|
||||
super(EquityInfoParser, self).__init__()
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
self.keys = keys
|
||||
self.records = {k: None for k in keys}
|
||||
self.do_record = {k: False for k in keys}
|
||||
|
Loading…
Reference in New Issue
Block a user