# HG changeset patch # User Paul Boddie # Date 1475756942 -7200 # Node ID d4cf5e36b192f65c37b5cc07752636bde5c25bd0 # Parent 5bc15bdabf2a81a4b1e9d3744d35fee1693e3858 Moved a general path-making function to the common module. diff -r 5bc15bdabf2a -r d4cf5e36b192 common.py --- a/common.py Thu Oct 06 14:28:05 2016 +0200 +++ b/common.py Thu Oct 06 14:29:02 2016 +0200 @@ -802,6 +802,15 @@ path, name, attrnames, access = location return get_attrnames(attrnames)[0] +def get_name_path(path, name): + + "Return a suitable qualified name from the given 'path' and 'name'." + + if "." in name: + return name + else: + return "%s.%s" % (path, name) + # Useful data. predefined_constants = "False", "None", "NotImplemented", "True" diff -r 5bc15bdabf2a -r d4cf5e36b192 deducer.py --- a/deducer.py Thu Oct 06 14:28:05 2016 +0200 +++ b/deducer.py Thu Oct 06 14:29:02 2016 +0200 @@ -20,7 +20,7 @@ """ from common import first, get_attrname_from_location, get_attrnames, \ - init_item, make_key, sorted_output, \ + get_name_path, init_item, make_key, sorted_output, \ CommonOutput from encoders import encode_attrnames, encode_access_location, \ encode_constrained, encode_location, encode_usage, \ @@ -1272,7 +1272,7 @@ # Obtain references to known objects. - path = self.get_name_path(unit_path, name) + path = get_name_path(unit_path, name) class_types, only_instance_types, module_types, constrained_specific = \ self.constrain_types(path, class_types, only_instance_types, module_types) @@ -1548,7 +1548,7 @@ """ location, name, attrnames, version = access_location - path = self.get_name_path(location, name) + path = get_name_path(location, name) # Use initialiser information, if available. @@ -1558,15 +1558,6 @@ else: return None - def get_name_path(self, path, name): - - "Return a suitable qualified name from the given 'path' and 'name'." - - if "." in name: - return name - else: - return "%s.%s" % (path, name) - def record_reference_types(self, location, class_types, instance_types, module_types, constrained, constrained_specific=False):