Created
July 4, 2015 08:27
-
-
Save josephrexme/be9906eb1d2118e6dd53 to your computer and use it in GitHub Desktop.
Parser method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse(self) | |
=begin | |
Method to parse the resource file for the terminal alias | |
provided, and populate the gw array with the terminal information. | |
Parameters | |
========== | |
None | |
Exceptions | |
========== | |
zipfile.BadZipfile - in case resource file cannot be read | |
AliasNotFound - if alias terminal not found in | |
resource file | |
=end | |
out = StringIO::StringIO | |
File.open(self.RESOURCE,'rb') do |f| | |
puts out.write(f.read) | |
end | |
begin | |
temp = zipfile.ZipFile(out) | |
rescue IOError => e | |
p e.message | |
end | |
if temp.namelist.include? "#{self.ALIAS}.xml" | |
t = temp.open("#{self.ALIAS}.xml") | |
s = self._xor() | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment