Skip to content

Commit

Permalink
change path generation rule to make every node unique
Browse files Browse the repository at this point in the history
This will change all MD5 change
  • Loading branch information
临寒 committed Jan 16, 2015
1 parent d80d36d commit 5791ab7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
with copen(readme_path, encoding='utf-8') as f:
long_description = f.read()

__version__ = '4.0.2'
__version__ = '4.1.0'

setup(
name="xUnique",
Expand Down
7 changes: 4 additions & 3 deletions xUnique.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def pbxproj_to_json(self):

def __set_to_result(self, parent_hex, current_hex, current_path_key):
current_node = self.nodes[current_hex]
isa_type = current_node['isa']
if isinstance(current_path_key, (list, tuple)):
current_path = '/'.join([current_node[i] for i in current_path_key])
elif isinstance(current_path_key, (basestring, unicode)):
Expand All @@ -110,9 +111,9 @@ def __set_to_result(self, parent_hex, current_hex, current_path_key):
raise KeyError('current_path_key must be list/tuple/string')
cur_abs_path = '{}/{}'.format(self.__result[parent_hex]['path'], current_path)
self.__result.update({
current_hex: {'path': cur_abs_path,
current_hex: {'path': '{}[{}]'.format(isa_type, cur_abs_path),
'new_key': md5_hex(cur_abs_path),
'type': self.nodes[current_hex]['isa']
'type': isa_type
}
})

Expand Down Expand Up @@ -450,7 +451,7 @@ def __unique_build_file(self, parent_hex, build_file_hex):
cur_path_key = self.__result[file_ref_hex]['path']
self.__set_to_result(parent_hex, build_file_hex, cur_path_key)
else:
self.vprint("PBXFileReference '", file_ref_hex, "' not found, it will be removed with its PBXBuildFile :", build_file_hex,sep='')
self.vprint("PBXFileReference '", file_ref_hex, "' not found inPBXBuildFile :", build_file_hex,'. To be removed.',sep='')
self.__result.setdefault('to_be_removed', []).extend((build_file_hex, file_ref_hex))

def __unique_build_rules(self, parent_hex, build_rule_hex):
Expand Down

0 comments on commit 5791ab7

Please sign in to comment.