[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #6471 [Metrics Utilities]: Design file format and Python/Java library for multiple GeoIP or AS databases
#6471: Design file format and Python/Java library for multiple GeoIP or AS
databases
-------------------------------+--------------------------------------------
Reporter: karsten | Owner:
Type: enhancement | Status: needs_revision
Priority: normal | Milestone:
Component: Metrics Utilities | Version:
Keywords: | Parent:
Points: | Actualpoints:
-------------------------------+--------------------------------------------
Comment(by gsathya):
{{{
93 def add_range(self, line):
94 r = Range(line)
95 self.data.append((r.key, r))
}}}
You might want to rename this to {{{_add_range}}} since you don't want
anyone using this method(since pygeodate is a lib) -- using this method
will make {{{self.data}}} unsorted and miss a key from {{{self.keys}}}. Or
you could be more safe and just remove the function since it's just two
lines.
{{{
76 def load_combined_databases(self, path):
77 with open(path) as input_file:
78 for line in input_file.readlines():
79 line = line.strip()
80 if line.startswith('!'):
81 self.add_date(line)
82 continue
83 else:
84 self.add_range(line)
}}}
What is the use of the continue here?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6471#comment:17>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs