示例#1
0
文件: setup.py 项目: gsdu8g9/floyd
scripts = ['floyd/bin/floyd']
packages = ['jinja2', 'markdown']

if os.name == 'nt':
    scripts.append('floyd/bin/floyd.bat')

package_dir = os.path.realpath(os.path.dirname(__file__))


def get_file_contents(file_path):
    """Get the context of the file using full path name"""
    full_path = os.path.join(package_dir, file_path)
    return open(full_path, 'r').read()


setup(
    name='floyd',
    description=floyd.__doc__.split('\n\n')[0],
    long_description=get_file_contents('README.md'),
    keywords='website, appengine, s3, cms, blog',
    url=floyd.__url__,
    platforms=['linux', 'osx', 'win32'],
    version=floyd.get_version(),
    author=floyd.__author__,
    author_email=floyd.__email__,
    license=get_file_contents('LICENSE'),
    install_requires=packages,
    packages=['floyd'],
    scripts=scripts,
)
示例#2
0
文件: setup.py 项目: nikcub/floyd
scripts = ['floyd/bin/floyd']
packages = [
  'jinja2',
  'markdown'
]

if os.name == 'nt':
  scripts.append('floyd/bin/floyd.bat')

package_dir = os.path.realpath(os.path.dirname(__file__))

def get_file_contents(file_path):
  """Get the context of the file using full path name"""
  full_path = os.path.join(package_dir, file_path)
  return open(full_path, 'r').read()

setup(
  name = 'floyd',
  description = floyd.__doc__.split('\n\n')[0],
  long_description = get_file_contents('README.md'),
  keywords = 'website, appengine, s3, cms, blog',
  url = floyd.__url__,
  platforms = ['linux', 'osx', 'win32'],
  version = floyd.get_version(),
  author = floyd.__author__,
  author_email = floyd.__email__,
  license = get_file_contents('LICENSE'),
  install_requires = packages,
  packages = ['floyd'],
  scripts = scripts,
)
示例#3
0
文件: server.py 项目: gsdu8g9/floyd
import sys
import threading
import re
import logging
import posixpath

from urlparse import urlparse
from urllib import unquote
from floyd import get_version

import BaseHTTPServer
from CGIHTTPServer import CGIHTTPRequestHandler
from SocketServer import ThreadingMixIn
from SimpleHTTPServer import SimpleHTTPRequestHandler

__version__ = get_version()
server_config = {}

class ServerException(Exception): pass

class Server(object):
  def __init__(self, path, port='8080', address='127.0.0.1'):
    if not os.path.isdir(path):
      raise ServerException('Not a valid directory to serve from: %s' % path)
    server_config['path'] = path
    self.path = path
    self.port = int(port)
    self.address = address
    self.running = False
    self.httpd = HTTPServer((address, port), StaticRequestHandler)
    self.sock = self.httpd.socket.getsockname()