Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow config files to be generated by a set of foaf files in a directory

  • Loading branch information...
commit 843a42b98251a769ebfafccd5315ace23a5dc445 1 parent d025fe5
@rubys authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 planet/foaf.py
View
7 planet/foaf.py
@@ -35,13 +35,13 @@ def handler(code, level, facility, message, line, column, byte, file, uri):
return model
# input = foaf, output = ConfigParser
-def foaf2config(rdf, config, subject=None):
+def foaf2config(rdf, config, subject=None, section=None):
if not config or not config.sections():
return
# there should be only be 1 section
- section = config.sections().pop()
+ if not section: section = config.sections().pop()
try:
from RDF import Model, NS, Parser, Statement
@@ -191,6 +191,7 @@ def friend2config(friend_model, friend, seeAlso, subconfig, data):
for uri in sys.argv[1:]:
config.add_section(uri)
- foaf2config(urllib.urlopen(uri), config)
+ foaf2config(urllib.urlopen(uri), config, section=uri)
+ config.remove_section(uri)
config.write(sys.stdout)
Please sign in to comment.
Something went wrong with that request. Please try again.