Skip to content

Commit b4b5353

Browse files
committed
Merge branch 'dev' into python3
2 parents 2bee718 + e7a2570 commit b4b5353

2 files changed

Lines changed: 43 additions & 8 deletions

File tree

python/phonenumbers/__init__.py

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,55 @@
7373
# I'll use regular expressions." Now they have two problems.'
7474
# -- jwz 1997-08-12
7575

76-
# Version number is taken from the upstream libphonenumber version
77-
# together with an indication of the version of the Python-specific code.
78-
__version__ = "4.5b1"
79-
8076
# Data class definitions
8177
from .phonenumber import PhoneNumber, CountryCodeSource, FrozenPhoneNumber
8278
from .phonemetadata import REGION_CODE_FOR_NON_GEO_ENTITY, NumberFormat, PhoneNumberDesc, PhoneMetadata
8379
# Functionality
8480
from .asyoutypeformatter import AsYouTypeFormatter
85-
from .phonenumberutil import *
81+
from .phonenumberutil import (COUNTRY_CODE_TO_REGION_CODE, SUPPORTED_REGIONS, UNKNOWN_REGION,
82+
MatchType, NumberParseException, PhoneNumberFormat,
83+
PhoneNumberType, ValidationResult,
84+
convert_alpha_characters_in_number,
85+
country_code_for_region,
86+
example_number,
87+
example_number_for_type,
88+
example_number_for_non_geo_entity,
89+
format_by_pattern,
90+
format_in_original_format,
91+
format_national_number_with_carrier_code,
92+
format_national_number_with_preferred_carrier_code,
93+
format_number_for_mobile_dialing,
94+
format_number,
95+
format_out_of_country_calling_number,
96+
format_out_of_country_keeping_alpha_chars,
97+
is_alpha_number,
98+
is_nanpa_country,
99+
is_number_match,
100+
is_possible_number,
101+
is_possible_number_string,
102+
is_possible_number_with_reason,
103+
is_valid_number,
104+
is_valid_number_for_region,
105+
length_of_geographical_area_code,
106+
length_of_national_destination_code,
107+
national_significant_number,
108+
ndd_prefix_for_region,
109+
normalize_digits_only,
110+
number_type,
111+
parse,
112+
region_code_for_country_code,
113+
region_code_for_number,
114+
truncate_too_long_number,)
86115
from .shortnumberutil import connects_to_emergency_number, is_emergency_number
87116
from .phonenumbermatcher import PhoneNumberMatch, PhoneNumberMatcher, Leniency
88117
from .geocoder import (area_description_for_number, country_name_for_number,
89118
description_for_number, description_for_valid_number)
90119

120+
121+
# Version number is taken from the upstream libphonenumber version
122+
# together with an indication of the version of the Python-specific code.
123+
__version__ = "4.5b1"
124+
91125
__all__ = ['PhoneNumber', 'CountryCodeSource', 'FrozenPhoneNumber',
92126
'REGION_CODE_FOR_NON_GEO_ENTITY', 'NumberFormat', 'PhoneNumberDesc', 'PhoneMetadata',
93127
'AsYouTypeFormatter',
@@ -126,6 +160,7 @@
126160
'region_code_for_country_code',
127161
'region_code_for_number',
128162
'truncate_too_long_number',
163+
# end of items from phonenumberutil.py
129164
'connects_to_emergency_number', 'is_emergency_number',
130165
'PhoneNumberMatch', 'PhoneNumberMatcher', 'Leniency',
131166
'area_description_for_number',

python/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
pass
2626

2727
major, minor = sys.version_info[:2]
28-
python_26 = (major > 2 or (major == 2 and minor >= 6))
29-
if not python_26:
30-
raise RuntimeError("Python 2.6 or newer is required")
28+
python_25 = (major > 2 or (major == 2 and minor >= 5))
29+
if not python_25:
30+
raise RuntimeError("Python 2.5 or newer is required")
3131
python_3x = (major >= 3)
3232
if python_3x:
3333
dev_status = 'Development Status :: 3 - Alpha'

0 commit comments

Comments
 (0)