Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
d93238d8
Commit
d93238d8
authored
Mar 18, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create_dir_if_necessary() is unnecessary
We already have makedirs_p()
parent
380d2177
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
10 deletions
+3
-10
i18n/dummy.py
+1
-2
i18n/execute.py
+0
-6
i18n/extract.py
+2
-2
No files found.
i18n/dummy.py
View file @
d93238d8
...
...
@@ -31,7 +31,6 @@ import polib
from
path
import
path
from
i18n.config
import
CONFIGURATION
from
i18n.execute
import
create_dir_if_necessary
from
i18n.converter
import
Converter
...
...
@@ -187,7 +186,7 @@ def make_dummy(filename, locale, converter):
pofile
.
metadata
[
'Plural-Forms'
]
=
'nplurals=2; plural=(n != 1);'
new_file
=
new_filename
(
filename
,
locale
)
create_dir_if_necessary
(
new_file
)
new_file
.
parent
.
makedirs_p
(
)
pofile
.
save
(
new_file
)
...
...
i18n/execute.py
View file @
d93238d8
...
...
@@ -34,12 +34,6 @@ def call(command, working_directory=BASE_DIR):
return
(
out
,
err
)
def
create_dir_if_necessary
(
pathname
):
dirname
=
os
.
path
.
dirname
(
pathname
)
if
not
os
.
path
.
exists
(
dirname
):
os
.
makedirs
(
dirname
)
def
remove_file
(
filename
,
verbose
=
True
):
"""
Attempt to delete filename.
...
...
i18n/extract.py
View file @
d93238d8
...
...
@@ -27,7 +27,7 @@ from path import path
from
polib
import
pofile
from
i18n.config
import
BASE_DIR
,
LOCALE_DIR
,
CONFIGURATION
from
i18n.execute
import
execute
,
create_dir_if_necessary
,
remove_file
from
i18n.execute
import
execute
,
remove_file
from
i18n.segment
import
segment_pofiles
...
...
@@ -46,7 +46,7 @@ def main(verbosity=1):
Main entry point of script
"""
logging
.
basicConfig
(
stream
=
sys
.
stdout
,
level
=
logging
.
INFO
)
create_dir_if_necessary
(
LOCALE_DIR
)
LOCALE_DIR
.
parent
.
makedirs_p
(
)
source_msgs_dir
=
CONFIGURATION
.
source_messages_dir
remove_file
(
source_msgs_dir
.
joinpath
(
'django.po'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment