Browse Source

Fixed console messages

main
Lakshmi Vyasarajan 13 years ago
parent
commit
145ede7b11
6 changed files with 11 additions and 10 deletions
  1. +2
    -1
      hyde/engine.py
  2. +1
    -1
      hyde/ext/plugins/folders.py
  3. +1
    -1
      hyde/generator.py
  4. +1
    -1
      hyde/plugin.py
  5. +5
    -5
      hyde/server.py
  6. +1
    -1
      hyde/site.py

+ 2
- 1
hyde/engine.py View File

@@ -52,7 +52,8 @@ class Engine(Application):
sitepath = Folder(Folder(args.sitepath).fully_expanded_path) sitepath = Folder(Folder(args.sitepath).fully_expanded_path)
if sitepath.exists and not args.overwrite: if sitepath.exists and not args.overwrite:
raise HydeException( raise HydeException(
"The given site path[%s] is not empty" % sitepath)
"The given site path [%s] already exists."
" Use -f to overwrite." % sitepath)
layout = Layout.find_layout(args.layout) layout = Layout.find_layout(args.layout)
logger.info( logger.info(
"Creating site at [%s] with layout [%s]" % (sitepath, layout)) "Creating site at [%s] with layout [%s]" % (sitepath, layout))


+ 1
- 1
hyde/ext/plugins/folders.py View File

@@ -36,7 +36,7 @@ class FlattenerPlugin(Plugin):
for resource in node.walk_resources(): for resource in node.walk_resources():
target_path = target.child(resource.name) target_path = target.child(resource.name)
self.logger.debug( self.logger.debug(
'Flattening resource path[%s] to [%s]' %
'Flattening resource path [%s] to [%s]' %
(resource, target_path)) (resource, target_path))
resource.relative_deploy_path = target_path resource.relative_deploy_path = target_path




+ 1
- 1
hyde/generator.py View File

@@ -307,7 +307,7 @@ class Generator(object):
context) context)
except Exception: except Exception:
logger.error("Error occurred when" logger.error("Error occurred when"
" processing template:[%s]" % resource)
" processing template: [%s]" % resource)
raise raise
else: else:
text = resource.source_file.read_all() text = resource.source_file.read_all()


+ 1
- 1
hyde/plugin.py View File

@@ -299,7 +299,7 @@ class CLTransformer(Plugin):
""" """
try: try:
self.logger.debug( self.logger.debug(
"Calling executable[%s] with arguments %s" %
"Calling executable [%s] with arguments %s" %
(args[0], str(args[1:]))) (args[0], str(args[1:])))
subprocess.check_call(args) subprocess.check_call(args)
except subprocess.CalledProcessError, error: except subprocess.CalledProcessError, error:


+ 5
- 5
hyde/server.py View File

@@ -34,7 +34,7 @@ class HydeRequestHandler(SimpleHTTPRequestHandler):
and serve. and serve.
""" """
self.server.request_time = datetime.now() self.server.request_time = datetime.now()
logger.info("Processing request:[%s]" % self.path)
logger.info("Processing request: [%s]" % self.path)
result = urlparse.urlparse(self.path) result = urlparse.urlparse(self.path)
query = urlparse.parse_qs(result.query) query = urlparse.parse_qs(result.query)
if 'refresh' in query or result.query=='refresh': if 'refresh' in query or result.query=='refresh':
@@ -45,7 +45,7 @@ class HydeRequestHandler(SimpleHTTPRequestHandler):
parts[4] = urllib.urlencode(query) parts[4] = urllib.urlencode(query)
parts = tuple(parts) parts = tuple(parts)
new_url = urlparse.urlunparse(parts) new_url = urlparse.urlunparse(parts)
logger.info('Redirecting...[%s]' % new_url)
logger.info('Redirecting... [%s]' % new_url)
self.redirect(new_url) self.redirect(new_url)
else: else:
SimpleHTTPRequestHandler.do_GET(self) SimpleHTTPRequestHandler.do_GET(self)
@@ -59,7 +59,7 @@ class HydeRequestHandler(SimpleHTTPRequestHandler):
path = SimpleHTTPRequestHandler.translate_path(self, path) path = SimpleHTTPRequestHandler.translate_path(self, path)
site = self.server.site site = self.server.site
result = urlparse.urlparse(self.path) result = urlparse.urlparse(self.path)
logger.debug("Trying to load file based on request:[%s]" % result.path)
logger.debug("Trying to load file based on request: [%s]" % result.path)
path = result.path.lstrip('/') path = result.path.lstrip('/')
res = None res = None
if path.strip() == "" or File(path).kind.strip() == "": if path.strip() == "" or File(path).kind.strip() == "":
@@ -72,7 +72,7 @@ class HydeRequestHandler(SimpleHTTPRequestHandler):
res = site.content.resource_from_relative_deploy_path(path) res = site.content.resource_from_relative_deploy_path(path)


if not res: if not res:
logger.error("Cannot load file:[%s]" % path)
logger.error("Cannot load file: [%s]" % path)


return site.config.deploy_root_path.child(path) return site.config.deploy_root_path.child(path)
else: else:
@@ -95,7 +95,7 @@ class HydeRequestHandler(SimpleHTTPRequestHandler):
message = "Requested resource not found" message = "Requested resource not found"
if not res: if not res:
logger.error( logger.error(
"Cannot find the 404 template[%s]."
"Cannot find the 404 template [%s]."
% site.config.not_found) % site.config.not_found)
else: else:
f404 = File(self.translate_path(site.config.not_found)) f404 = File(self.translate_path(site.config.not_found))


+ 1
- 1
hyde/site.py View File

@@ -323,7 +323,7 @@ class RootNode(Node):
""" """


if not self.source_folder.exists: if not self.source_folder.exists:
raise HydeException("The given source folder[%s]"
raise HydeException("The given source folder [%s]"
" does not exist" % self.source_folder) " does not exist" % self.source_folder)


with self.source_folder.walker as walker: with self.source_folder.walker as walker:


Loading…
Cancel
Save