mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
31e09338f6
commit
1ebba8e780
@ -5,7 +5,8 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os, re, cStringIO, base64, httplib, subprocess, hashlib, shutil, time, glob
|
import os, re, cStringIO, base64, httplib, subprocess, hashlib, shutil, time, \
|
||||||
|
glob, stat
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
from tempfile import NamedTemporaryFile, mkdtemp
|
from tempfile import NamedTemporaryFile, mkdtemp
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
@ -344,6 +345,8 @@ class UploadUserManual(Command): # {{{
|
|||||||
def build_plugin_example(self, path):
|
def build_plugin_example(self, path):
|
||||||
from calibre import CurrentDir
|
from calibre import CurrentDir
|
||||||
with NamedTemporaryFile(suffix='.zip') as f:
|
with NamedTemporaryFile(suffix='.zip') as f:
|
||||||
|
os.fchmod(f.fileno(),
|
||||||
|
stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH|stat.S_IWRITE)
|
||||||
with CurrentDir(self.d(path)):
|
with CurrentDir(self.d(path)):
|
||||||
with ZipFile(f, 'w') as zf:
|
with ZipFile(f, 'w') as zf:
|
||||||
for x in os.listdir('.'):
|
for x in os.listdir('.'):
|
||||||
@ -352,8 +355,8 @@ class UploadUserManual(Command): # {{{
|
|||||||
for y in os.listdir(x):
|
for y in os.listdir(x):
|
||||||
zf.write(os.path.join(x, y))
|
zf.write(os.path.join(x, y))
|
||||||
bname = self.b(path) + '_plugin.zip'
|
bname = self.b(path) + '_plugin.zip'
|
||||||
subprocess.check_call(['scp', f.name, 'divok:%s/%s'%(DOWNLOADS,
|
dest = '%s/%s'%(DOWNLOADS, bname)
|
||||||
bname)])
|
subprocess.check_call(['scp', f.name, dest])
|
||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
path = self.j(self.SRC, 'calibre', 'manual', 'plugin_examples')
|
path = self.j(self.SRC, 'calibre', 'manual', 'plugin_examples')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user