Skip to content

Commit

Permalink
Merge pull request #48 from Project-Path-of-Exile-Wiki/dev
Browse files Browse the repository at this point in the history
3.16 - Pre-release merge, patch version 2.
  • Loading branch information
pm5k authored Nov 9, 2021
2 parents c1682a8 + 4e1304e commit 789aab3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
2 changes: 0 additions & 2 deletions PyPoE/cli/exporter/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ def get_content_path():


def fix_path(path: str) -> str:
#First, replace any double quotes with HTML-encoded quotes
path = path.replace('\"','"')
if re.search('[a-zA-Z]:.*', path) is not None:
return path[:2] + re.sub(r':', '_', path[2:])
else:
Expand Down
8 changes: 4 additions & 4 deletions PyPoE/cli/exporter/wiki/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@

WIKIS = {
'English': 'www.poewiki.net/w',
'Russian': 'pathofexile-ru.gamepedia.com',
'German': 'pathofexile-de.gamepedia.com',
'French': 'pathofexile-fr.gamepedia.com',
'Spanish': 'pathofexile-es.gamepedia.com',
'Russian': 'pathofexile.fandom.com/ru',
'German': 'pathofexile.fandom.com/de',
'French': 'pathofexile.fandom.com/fr',
'Spanish': 'pathofexile.fandom.com/es',
}

# =============================================================================
Expand Down
19 changes: 19 additions & 0 deletions PyPoE/cli/exporter/wiki/parsers/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -3717,6 +3717,8 @@ def _export(self, parsed_args, items):
cls_id = base_item_type['ItemClassesKey']['Id']
m_id = base_item_type['Id']

self._print_item_rowid(parsed_args, base_item_type)

infobox = OrderedDict()
self._process_base_item_type(base_item_type, infobox)
self._process_purchase_costs(base_item_type, infobox)
Expand Down Expand Up @@ -3804,6 +3806,23 @@ def _export(self, parsed_args, items):

return r

def _print_item_rowid(self, parsed_args, base_item_type):
#Don't print anything if not running in the rowid mode.
if not set(['start', 'end']).issubset(vars(parsed_args).keys()):
return

export_row_count = parsed_args.end - parsed_args.start
#If we're printing less than 100 rows, print every rowid
if export_row_count <= 100:
print_granularity = 1
else:
print_granularity = export_row_count//100

item_offset = base_item_type.rowid - parsed_args.start
if (item_offset == 0) or item_offset % print_granularity == 0:
console(f"Processing item with rowid {base_item_type.rowid}: {base_item_type['Name']}")
return

def _format_map_name(self, base_item_type, map_series, language=None):
if language is None:
language = self._language
Expand Down
4 changes: 2 additions & 2 deletions PyPoE/cli/exporter/wiki/parsers/lua.py
Original file line number Diff line number Diff line change
Expand Up @@ -1439,8 +1439,8 @@ def DetermineModifier(val):
# 'key': 'mod_group',
# 'default': '',
# }),
('CraftingItemClassCategories', {
'key': 'crafting_item_class_categories',
('CraftingItemClassCategoriesKeys', {
'key': 'item_class_categories',
'value': lambda v: [k['Text'] for k in v],
}),
# ('CraftingBenchUnlockCategoriesKeys', {
Expand Down
4 changes: 2 additions & 2 deletions PyPoE/cli/exporter/wiki/parsers/skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def export(self, parsed_args, skills):
if not parsed_args.allow_skill_gems and skill in \
self.rr['SkillGems.dat'].index['GrantedEffectsKey']:
console(
'Skipping skill gem skill "%s"' % skill['Id'],
f"Skipping skill gem skill \"{skill['Id']}\" at row {skill.rowid}",
msg=Msg.warning)
continue
data = OrderedDict()
Expand All @@ -751,7 +751,7 @@ def export(self, parsed_args, skills):
self._skill(ge=skill, infobox=data, parsed_args=parsed_args)
except Exception as e:
console(
'Error when parsing skill "%s":' % skill['Id'],
f"Error when parsing skill \"{skill['Id']}\" at {skill.rowid}:",
msg=Msg.error)
console(traceback.format_exc(), msg=Msg.error)

Expand Down

0 comments on commit 789aab3

Please sign in to comment.