Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/geoserver/catalog.py b/src/geoserver/catalog.py
index 8f5331e..4f0a2e5 100644
--- a/src/geoserver/catalog.py
+++ b/src/geoserver/catalog.py
@@ -56,6 +56,12 @@ class Catalog(object):
None,
self.http
))
+ orig_req = self.http.request
+ def wrapped_request(*args, **kwargs):
val file = new java.io.FileInputStream(args(0))
val inflater = new java.util.zip.InflaterInputStream(file)
val bytes = Iterator.continually(inflater.read) takeWhile(-1 !=)
bytes.foreach(System.out.write)
System.out.flush()
trait MyString {
def theString: String
}
case class AString(theString: String) extends MyString
case class IntAsString(theInt: Int) extends MyString {
def theString = theInt.toString
}
object MyString {
@dwins
dwins / project.scala
Created January 18, 2011 15:51
project.scala
override def repositories = super.repositories ++ Set(
"fusesource.m2" at "http://repo.fusesource.com/nexus/content/repositories/public/"
)
override def libraryDependencies = super.libraryDependencies ++ Set(
"org.fusesource.scalate" % "scalate-core" % "1.3.2"
)
def reverse[A](xs: List[A]): List[A] = {
def reverse0(xs: List[A], accum: List[A]): List[A] =
xs match {
case Nil => accum
case h :: t => reverse0(t, h :: accum)
}
reverse0(xs, Nil)
}
#! /usr/bin/env python
from geoserver.catalog import Catalog
cat = Catalog('http://demo.geonode.org/geoserver-geonode-dev/rest/') # + username, password)...
def check(x):
for name in dir(x):
if getattr(x, name) is None:
print x, name, "IS NONE"
function checkup() {
REPO="$1"
WORKING_DIR="$2"
if [ -d "${WORKING_DIR}" ];
then
echo "Updating ${WORKING_DIR} from upstream"
# (cd "${WORKING_DIR}" && git pull)
else
git clone "${REPO}" "${WORKING_DIR}"
fi
apache-tomcat-6.0.32/bin/catalina.sh start
paster serve --reload riab_geonode/riab/deploy/project.paste.ini
apache-tomcat-6.0.32/bin/catalina.sh stop
@dwins
dwins / find_nulls.py
Created March 28, 2011 19:18
test geoserver config using gsconfig.py
#! /usr/bin/env python
from geoserver.catalog import Catalog
cat = Catalog('http://host/geoserver/rest', 'user', 'password')
def internal_name(s):
return s.startswith("__") and s.endswith("__")
def check(x):
override def managedStyle = ManagedStyle.Maven
lazy val publishTo = Resolver.file("local maven repo", (Path.userHome / ".m2" / "repository") asFile)