Skip to content

Commit

Permalink
i18n/zh_CN: reformat code and ignore _
Browse files Browse the repository at this point in the history
1. update `Pyfa_Inspections.xml` to ignore `_`

i18n module `gettext` will do a `gettext.install(...)` to put `_` function into `builtin` module. Currently PyCharm does not recognize this as a function and report as unresolved reference.

2. reformat code to remove padding for vertical dicts

3. update `Pyfa_CodeStyle.xml` to not pad vertical dicts

(cherry picked from commit e5a570a)
  • Loading branch information
zhaoweny authored and blitzmann committed Jun 20, 2020
1 parent 2d3a661 commit 3d9b4c1
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 69 deletions.
1 change: 0 additions & 1 deletion _development/Pyfa_CodeStyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<option name="RIGHT_MARGIN" value="165" />
<Python>
<option name="NEW_LINE_AFTER_COLON" value="true" />
<option name="DICT_ALIGNMENT" value="2" />
<option name="DICT_NEW_LINE_AFTER_LEFT_BRACE" value="true" />
<option name="DICT_NEW_LINE_BEFORE_RIGHT_BRACE" value="true" />
<option name="USE_CONTINUATION_INDENT_FOR_ARGUMENTS" value="true" />
Expand Down
111 changes: 59 additions & 52 deletions _development/Pyfa_Inspections.xml
Original file line number Diff line number Diff line change
@@ -1,54 +1,61 @@
<profile version="1.0">
<option name="myName" value="Pyfa" />
<inspection_tool class="IgnoreUnusedEntry" enabled="false" level="UNUSED ENTRY" enabled_by_default="false" />
<inspection_tool class="InconsistentLineSeparators" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ProblematicWhitespace" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyBehaveInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyClassicStyleClassInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ourVersions">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="2.7" />
<profile version="1.0">
<option name="myName" value="Pyfa" />
<inspection_tool class="IgnoreUnusedEntry" enabled="false" level="UNUSED ENTRY" enabled_by_default="false" />
<inspection_tool class="InconsistentLineSeparators" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ProblematicWhitespace" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyBehaveInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyClassicStyleClassInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ourVersions">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="2.7" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyMissingTypeHintsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="wxPython" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyPep8Inspection" enabled="true" level="TYPO" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E203" />
<option value="E127" />
<option value="E128" />
<option value="E126" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyMissingTypeHintsInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="wxPython" />
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="TYPO" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N806" />
<option value="N803" />
<option value="N814" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyPep8Inspection" enabled="true" level="TYPO" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E203" />
<option value="E127" />
<option value="E128" />
<option value="E126" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="TYPO" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N806" />
<option value="N803" />
<option value="N814" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyShadowingBuiltinsInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyShadowingNamesInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
</option>
</inspection_tool>
<inspection_tool class="PyShadowingBuiltinsInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyShadowingNamesInspection" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="_" />
</list>
</option>
</inspection_tool>
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
12 changes: 6 additions & 6 deletions gui/builtinStatsViews/resistancesViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def populatePanel(self, contentPanel, headerPanel):
sizerResistances.Add(wx.StaticText(contentPanel, wx.ID_ANY), wx.GBPosition(row, col), wx.GBSpan(1, 1))
col += 1
toolTipText = {
"em" : _("Electromagnetic resistance"),
"thermal" : _("Thermal resistance"),
"kinetic" : _("Kinetic resistance"),
"em": _("Electromagnetic resistance"),
"thermal": _("Thermal resistance"),
"kinetic": _("Kinetic resistance"),
"explosive": _("Explosive resistance")
}
for damageType in ("em", "thermal", "kinetic", "explosive"):
Expand All @@ -107,9 +107,9 @@ def populatePanel(self, contentPanel, headerPanel):
((198, 133, 38), (81, 83, 67)))

toolTipText = {
"shield" : _("Shield resistance"),
"armor" : _("Armor resistance"),
"hull" : _("Hull resistance"),
"shield": _("Shield resistance"),
"armor": _("Armor resistance"),
"hull": _("Hull resistance"),
"damagePattern": _("Incoming damage pattern")
}
for tankType in ("shield", "armor", "hull", "separator", "damagePattern"):
Expand Down
20 changes: 10 additions & 10 deletions gui/builtinStatsViews/resourcesViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ def populatePanel(self, contentPanel, headerPanel):
sizer.AddStretchSpacer()
# Turrets & launcher hardslots display
tooltipText = {
"turret" : _("Turret hardpoints"),
"launcher" : _("Launcher hardpoints"),
"drones" : _("Drones active"),
"fighter" : _("Fighter squadrons active"),
"turret": _("Turret hardpoints"),
"launcher": _("Launcher hardpoints"),
"drones": _("Drones active"),
"fighter": _("Fighter squadrons active"),
"calibration": _("Calibration")
}
for type_ in ("turret", "launcher", "drones", "fighter", "calibration"):
Expand All @@ -124,7 +124,7 @@ def populatePanel(self, contentPanel, headerPanel):
sizer.Add(box, 0, wx.ALIGN_CENTER)

suffix = {
'turret' : 'Hardpoints', 'launcher': 'Hardpoints', 'drones': 'Active', 'fighter': 'Tubes',
'turret': 'Hardpoints', 'launcher': 'Hardpoints', 'drones': 'Active', 'fighter': 'Tubes',
'calibration': 'Points'
}
lbl = wx.StaticText(parent, wx.ID_ANY, "0")
Expand All @@ -148,12 +148,12 @@ def populatePanel(self, contentPanel, headerPanel):

# PG, Cpu & drone stuff
tooltipText = {
"cpu" : _("CPU"),
"pg" : _("PowerGrid"),
"droneBay" : _("Drone bay"),
"fighterBay" : _("Fighter bay"),
"cpu": _("CPU"),
"pg": _("PowerGrid"),
"droneBay": _("Drone bay"),
"fighterBay": _("Fighter bay"),
"droneBandwidth": _("Drone bandwidth"),
"cargoBay" : _("Cargo bay")
"cargoBay": _("Cargo bay")
}
for i, group in enumerate((("cpu", "pg"), ("cargoBay", "droneBay", "fighterBay", "droneBandwidth"))):
main = wx.BoxSizer(wx.VERTICAL)
Expand Down

0 comments on commit 3d9b4c1

Please sign in to comment.