Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove loader/dumper code

  • Loading branch information...
commit d3644f31c42eb1df5fc41531b33b13327844c976 1 parent 90f4ccd
@palfrey authored
Showing with 2 additions and 36 deletions.
  1. +0 −1  .gitignore
  2. +0 −12 Makefile
  3. +2 −1  books.py
  4. +0 −12 dumper.py
  5. +0 −10 loader.py
View
1  .gitignore
@@ -1,4 +1,3 @@
-series.list
*.mobi
*.zip
cache
View
12 Makefile
@@ -1,12 +0,0 @@
-all: blog_pb2.py
-
-blog_pb2.py: blog.proto
- protoc --python_out=. blog.proto
-
-load::
- python loader.py series.txt series.list
-
-dump::
- python dumper.py series.list series.txt
-
-.PHONY: load dump
View
3  books.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from urlgrab import Cache
+from google.protobuf import text_format
from blog_pb2 import All
from re import compile, DOTALL, MULTILINE
from os import mkdir, system
@@ -13,7 +14,7 @@
c = Cache()
db = All()
-db.ParseFromString(open("series.list", "rb").read())
+text_format.Merge(open("series.txt","rb","utf-8").read(),db)
wrong = {
u"“": u"\"",
View
12 dumper.py
@@ -1,12 +0,0 @@
-from google.protobuf import text_format
-from sys import argv
-from codecs import open
-
-from blog_pb2 import All
-
-db = All()
-db.ParseFromString(open(argv[1],"rb").read())
-out = text_format.MessageToString(db)
-open(argv[2],"wb").write(out)
-
-
View
10 loader.py
@@ -1,10 +0,0 @@
-from google.protobuf import text_format
-from sys import argv
-from codecs import open
-
-from blog_pb2 import All
-
-db = All()
-text_format.Merge(open(argv[1],"rb","utf-8").read(),db)
-open(argv[2],"wb").write(db.SerializeToString())
-
Please sign in to comment.
Something went wrong with that request. Please try again.