Cleanup previous PR

This commit is contained in:
Kovid Goyal 2024-06-17 10:34:46 +05:30
parent 42556d3f23
commit d10c85ba5d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 17 additions and 17 deletions

View File

@ -360,7 +360,8 @@ class Bootstrap(Command):
def add_options(self, parser):
parser.add_option('--ephemeral', default=False, action='store_true',
help='Do not download all history for the translations. Speeds up first time download but subsequent downloads will be slower.')
parser.add_option('--path-to-translations', help='Path to sources of translations')
parser.add_option('--path-to-translations',
help='Path to existing out-of-tree translations checkout. Use this to avoid downloading translations at all.')
def pre_sub_commands(self, opts):
tdir = self.j(self.d(self.SRC), 'translations')
@ -373,12 +374,12 @@ class Bootstrap(Command):
# Change permissions for the top-level folder
os.chmod(tdir, 0o755)
for root, dirs, files in os.walk(tdir):
# set perms on sub-directories
for momo in dirs:
os.chmod(os.path.join(root, momo), 0o755)
# set perms on files
for momo in files:
os.chmod(os.path.join(root, momo), 0o644)
# set perms on sub-directories
for momo in dirs:
os.chmod(os.path.join(root, momo), 0o755)
# set perms on files
for momo in files:
os.chmod(os.path.join(root, momo), 0o644)
elif opts.ephemeral:
if os.path.exists(tdir):

View File

@ -2,24 +2,24 @@
# License: GPLv3 Copyright: 2023, Kovid Goyal <kovid at kovidgoyal.net>
import fnmatch
import optparse
import os
import shutil
import time
import zipfile
from contextlib import suppress
from io import BytesIO
from setup import download_securely, Command
from setup import Command, download_securely
class ISOData(Command):
description = 'Get iso-codes data'
URL = f'https://salsa.debian.org/iso-codes-team/iso-codes/-/archive/main/iso-codes-main.zip'
description = 'Get ISO codes name localization data'
URL = 'https://salsa.debian.org/iso-codes-team/iso-codes/-/archive/main/iso-codes-main.zip'
def add_options(self, parser):
if self.option_added:
return
parser.add_option('--path-to-isocodes', help='Path to iso-codes.zip')
self.option_added = True
with suppress(optparse.OptionConflictError): # ignore if option already added
parser.add_option('--path-to-isocodes', help='Path to previously downloaded iso-codes-main.zip')
def run(self, opts):
if self._zip_data is None:
@ -37,7 +37,6 @@ class ISOData(Command):
super().__init__()
self._zip_data = None
self.top_level = 'iso-codes-main'
self.option_added = False
@property
def zip_data(self):

View File

@ -142,7 +142,7 @@ class CACerts(Command): # {{{
CA_PATH = os.path.join(Command.RESOURCES, 'mozilla-ca-certs.pem')
def add_options(self, parser):
parser.add_option('--path-to-cacerts', help='Path to mozilla-ca-certs.pem')
parser.add_option('--path-to-cacerts', help='Path to previously downloaded mozilla-ca-certs.pem')
def run(self, opts):
if opts.path_to_cacerts:
@ -177,7 +177,7 @@ class RecentUAs(Command): # {{{
UA_PATH = os.path.join(Command.RESOURCES, 'user-agent-data.json')
def add_options(self, parser):
parser.add_option('--path-to-user-agent-data', help='Path to user-agent-data.json')
parser.add_option('--path-to-user-agent-data', help='Path to previously downloaded user-agent-data.json')
def run(self, opts):
from setup.browser_data import get_data