5
from distutils.core import setup, Command
6
from distutils.command import clean
7
# pylint: disable-msg=F0401
8
from DistUtilsExtra.command import build_extra
9
from contrib import build_icons, check
13
class UbuntuOneBuildu1fsfsm(Command):
14
"""Class to build u1fsfsm.py from the ods file."""
16
description = "build the u1fsfsm.py file"
20
def initialize_options(self):
21
"""Initialize some options."""
23
def finalize_options(self):
24
"""Finaliaze the options."""
28
sdpath = os.path.join("canonical", "ubuntuone",
29
"storage", "syncdaemon")
31
command1 = ["python", "-t",
32
os.path.join(sdpath, "fsm", "fsm_parser.py"),
33
"-o", os.path.join(sdpath, "u1fsfsm.py"),
34
os.path.join(sdpath, "u1fsfsm.ods")]
35
command2 = ["python", "-t",
36
os.path.join(sdpath, "fsm", "fsm.py"),
37
os.path.join(sdpath, "u1fsfsm.py")]
39
xdg_cache = os.path.join(os.getcwd(), "_trial_temp", "xdg_cache")
40
if not os.path.exists(xdg_cache):
41
os.makedirs(xdg_cache)
43
env = { "PYTHONPATH" : os.getcwd(),
44
"HAS_OOFFICE" : "true",
45
"XDG_CACHE_HOME" : xdg_cache }
47
ret1 = subprocess.call(command1, env=env)
48
ret2 = subprocess.call(command2, env=env)
50
if ret1 != 0 or ret2 != 0:
51
sys.stderr.write("[ERROR] Failed to build u1fsfsm.py.\n")
54
setup(name='ubuntuone-client',
55
version = '@VERSION@',
60
'build' : build_extra.build_extra,
61
'build_icons' : build_icons.build_icons,
62
'check' : check.check,
63
'build_u1fsfsm' : UbuntuOneBuildu1fsfsm,