Commit 614b80ce authored by Giorgos Verigakis's avatar Giorgos Verigakis
Browse files

Rename to

Use absolute imports
Update build script
parent eb3ca8ca
#!/usr/bin/env python
import os
import shutil
import stat
from os.path import exists, join
SRCDIR = 'kamaki'
SRC = ''
DSTDIR = 'bin'
DST = 'kamaki'
FILES = ('', '', '', '')
def cat(path, dst, skipheader=True):
in_header = True
for line in open(path):
if in_header and line.strip() and not line.startswith('#'):
in_header = False
if line.startswith('from kamaki.'):
continue # Skip local imports
if skipheader and in_header:
def main():
if not os.path.exists(DSTDIR):
if not exists(DSTDIR):
dstpath = os.path.join(DSTDIR, DST)
dstpath = join(DSTDIR, DST)
dst = open(dstpath, 'w')
srcpath = os.path.join(SRCDIR, SRC)
clientpath = os.path.join(SRCDIR, CLIENT)
for line in open(srcpath):
if line.startswith('from client import'):
for l in open(clientpath):
if l.startswith('#'):
continue # Skip comments
dst.write('#!/usr/bin/env python\n')
cat(join(SRCDIR, ''), dst, skipheader=False)
for file in FILES:
cat(join(SRCDIR, file), dst)
......@@ -76,9 +76,9 @@ from grp import getgrgid
from optparse import OptionParser
from pwd import getpwuid
from client import ComputeClient, ImagesClient, ClientError
from config import Config, ConfigError
from utils import OrderedDict, print_addresses, print_dict, print_items
from kamaki.client import ComputeClient, ImagesClient, ClientError
from kamaki.config import Config, ConfigError
from kamaki.utils import OrderedDict, print_addresses, print_dict, print_items
# Path to the file that stores the configuration
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment