Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pygeoip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pygeoip
Commits
59e1bc09
Commit
59e1bc09
authored
Jul 21, 2013
by
Jiri Techet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary parentheses
Detected by PyCharm inspections
parent
f4ba4b61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
pygeoip/__init__.py
+5
-4
pygeoip/timezone.py
+1
-1
No files found.
pygeoip/__init__.py
View file @
59e1bc09
...
@@ -165,7 +165,7 @@ class GeoIP(object):
...
@@ -165,7 +165,7 @@ class GeoIP(object):
self
.
_databaseType
=
ord
(
byte
)
self
.
_databaseType
=
ord
(
byte
)
# Compatibility with databases from April 2003 and earlier
# Compatibility with databases from April 2003 and earlier
if
(
self
.
_databaseType
>=
106
)
:
if
self
.
_databaseType
>=
106
:
self
.
_databaseType
-=
105
self
.
_databaseType
-=
105
if
self
.
_databaseType
==
const
.
REGION_EDITION_REV0
:
if
self
.
_databaseType
==
const
.
REGION_EDITION_REV0
:
...
@@ -361,15 +361,16 @@ class GeoIP(object):
...
@@ -361,15 +361,16 @@ class GeoIP(object):
record
[
'continent'
]
=
const
.
CONTINENT_NAMES
[
char
]
record
[
'continent'
]
=
const
.
CONTINENT_NAMES
[
char
]
buf_pos
+=
1
buf_pos
+=
1
def
get_data
(
buf
,
buf_pos
):
def
get_data
(
buf
,
buf_pos
):
offset
=
buf_pos
offset
=
buf_pos
char
=
ord
(
buf
[
offset
])
char
=
ord
(
buf
[
offset
])
while
(
char
!=
0
)
:
while
char
!=
0
:
offset
+=
1
offset
+=
1
char
=
ord
(
buf
[
offset
])
char
=
ord
(
buf
[
offset
])
if
offset
>
buf_pos
:
if
offset
>
buf_pos
:
return
(
offset
,
buf
[
buf_pos
:
offset
])
return
offset
,
buf
[
buf_pos
:
offset
]
return
(
offset
,
''
)
return
offset
,
''
offset
,
record
[
'region_name'
]
=
get_data
(
buf
,
buf_pos
)
offset
,
record
[
'region_name'
]
=
get_data
(
buf
,
buf_pos
)
offset
,
record
[
'city'
]
=
get_data
(
buf
,
offset
+
1
)
offset
,
record
[
'city'
]
=
get_data
(
buf
,
offset
+
1
)
...
...
pygeoip/timezone.py
View file @
59e1bc09
...
@@ -740,7 +740,7 @@ _country = {
...
@@ -740,7 +740,7 @@ _country = {
'ZA'
:
'Africa/Johannesburg'
,
'ZA'
:
'Africa/Johannesburg'
,
'ZM'
:
'Africa/Lusaka'
,
'ZM'
:
'Africa/Lusaka'
,
'ZW'
:
'Africa/Harare'
'ZW'
:
'Africa/Harare'
}
}
def
time_zone_by_country_and_region
(
country_code
,
region_name
=
None
):
def
time_zone_by_country_and_region
(
country_code
,
region_name
=
None
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment