# HG changeset patch # User Paul Boddie # Date 1475756942 -7200 # Node ID a31283db845b086030f39a9d95ef0b3f0608b3ea # Parent 3b3bb6a8a762b0a5739b299f6293e99c863290cc Moved a general path-making function to the common module. diff -r 3b3bb6a8a762 -r a31283db845b common.py --- a/common.py Fri Oct 07 21:18:06 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 3b3bb6a8a762 -r a31283db845b deducer.py --- a/deducer.py Fri Oct 07 21:18:06 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, \ @@ -1271,7 +1271,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) @@ -1547,7 +1547,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. @@ -1557,15 +1557,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):