コード例 #1
0
ファイル: precompilers.py プロジェクト: RuuPiE/bount
    def compile(self):
        super(CoffeePrecompiler, self).compile()

        abs_dir_from = self.abs_dir_from()
        abs_dir_to = self.abs_dir_to()

        with cuisine.cuisine_sudo():
            dir_ensure(abs_dir_to, mode='777', recursive=True)
        
        cuisine.sudo('sudo coffee --compile --output %(abs_dir_to)s %(abs_dir_from)s' % {'abs_dir_from': abs_dir_from, 'abs_dir_to': abs_dir_to})
コード例 #2
0
ファイル: precompilers.py プロジェクト: mturilin/bount
    def compile(self):
        super(CoffeePrecompiler, self).compile()

        abs_dir_from = self.abs_dir_from()
        abs_dir_to = self.abs_dir_to()

        with cuisine.cuisine_sudo():
            dir_ensure(abs_dir_to, mode="777", recursive=True)

        cuisine.sudo(
            "sudo coffee --compile --output %(abs_dir_to)s %(abs_dir_from)s"
            % {"abs_dir_from": abs_dir_from, "abs_dir_to": abs_dir_to}
        )
コード例 #3
0
ファイル: stacks.py プロジェクト: unicodefreak/bount
    def restore_latest_media(self):
        dump_basename = self.latest_media_dump_basename()

        dump_local_path = self.local_media_dump_dir.joinpath(dump_basename)
        dump_remote_path = path(self.django.media_root).joinpath(dump_basename)

        put(str(dump_local_path), str(dump_remote_path), use_sudo=True, mode=0777)

        with cd(self.django.media_root):
            sudo("tar -xvzf %s" % dump_remote_path)

        with cuisine_sudo():
            dir_attribs(self.django.media_root, mode='777', recursive=True)

        with cuisine_sudo(): file_delete(dump_remote_path)
コード例 #4
0
ファイル: precompilers.py プロジェクト: RuuPiE/bount
    def compile(self):
        super(LessPrecompiler, self).compile()
        abs_dir_from = self.abs_dir_from()
        abs_dir_to = self.abs_dir_to()

        with cuisine.cuisine_sudo():
            dir_ensure(abs_dir_to, mode='777', recursive=True)

        for a_file in ls_re(abs_dir_from, '.*\\.less'):
            cuisine.sudo('%(lessc_path)s %(dir_from)s/%(basename)s.less %(dir_to)s/%(basename)s.css' % \
             {
                 'lessc_path': self.lessc_path(),
                 'dir_from': abs_dir_from,
                 'dir_to': abs_dir_to,
                 'basename': a_file[:-5]
             })
コード例 #5
0
ファイル: precompilers.py プロジェクト: mturilin/bount
    def compile(self):
        super(LessPrecompiler, self).compile()
        abs_dir_from = self.abs_dir_from()
        abs_dir_to = self.abs_dir_to()

        with cuisine.cuisine_sudo():
            dir_ensure(abs_dir_to, mode="777", recursive=True)

        for a_file in ls_re(abs_dir_from, ".*\\.less"):
            cuisine.sudo(
                "%(lessc_path)s %(dir_from)s/%(basename)s.less %(dir_to)s/%(basename)s.css"
                % {
                    "lessc_path": self.lessc_path(),
                    "dir_from": abs_dir_from,
                    "dir_to": abs_dir_to,
                    "basename": a_file[:-5],
                }
            )
コード例 #6
0
ファイル: precompilers.py プロジェクト: RuuPiE/bount
    def setup(self):
        if not file_exists(self.lessc_path()):
            print("Installing Node and Less")
            cuisine.sudo("sudo apt-get --yes install python-software-properties")
            cuisine.sudo("sudo add-apt-repository ppa:chris-lea/node.js --yes")
            cuisine.sudo("sudo apt-get --yes update")
            cuisine.sudo("sudo apt-get --yes install nodejs")

            cuisine.run("curl http://npmjs.org/install.sh | sudo sh")

            with cd('~'):
                cuisine.run("npm install less")
        else:
            print ("Less is already installed")
コード例 #7
0
ファイル: managers.py プロジェクト: mturilin/bount
 def refresh_sources(self):
     sudo("apt-get update")
コード例 #8
0
ファイル: managers.py プロジェクト: openxe/bount
 def disable_ntpd(self):
     sudo('service ntp stop')
コード例 #9
0
ファイル: managers.py プロジェクト: openxe/bount
 def enable_ntpd(self):
     sudo('service ntp start')
コード例 #10
0
ファイル: managers.py プロジェクト: openxe/bount
 def refresh_sources(self):
     sudo('apt-get update')
コード例 #11
0
ファイル: managers.py プロジェクト: openxe/bount
 def stop(self):
     sudo("service apache2 stop")
コード例 #12
0
ファイル: managers.py プロジェクト: openxe/bount
 def start(self):
     sudo("service apache2 start")
コード例 #13
0
ファイル: managers.py プロジェクト: openxe/bount
 def restart(self):
     sudo("service apache2 restart")
コード例 #14
0
ファイル: managers.py プロジェクト: openxe/bount
 def drop_database(self):
     sudo("service postgresql restart")
     sudo("echo DROP DATABASE %s | psql" % self.database_name, user=self.superuser_login)
コード例 #15
0
ファイル: managers.py プロジェクト: mturilin/bount
 def enable_ntpd(self):
     sudo("service ntp start")
コード例 #16
0
ファイル: utils.py プロジェクト: mturilin/bount
def copy_directory_content(from_dir, to_dir):
    cuisine.sudo("cp -pr %s/* %s" % (from_dir, to_dir))
コード例 #17
0
ファイル: managers.py プロジェクト: mturilin/bount
 def disable_ntpd(self):
     sudo("service ntp stop")