Skip to content

Commit

Permalink
Merge pull request #2235 from camptocamp/windows
Browse files Browse the repository at this point in the history
Some fix for windows
  • Loading branch information
sbrunner committed May 18, 2016
2 parents a4775ab + 46319f4 commit 8cfe274
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions c2cgeoportal/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ def __call__(self, request, elements, kw):
@implementer(IStaticURLInfo)
class MultiDomainStaticURLInfo(StaticURLInfo): # pragma: no cover
def generate(self, path, request, **kw):
if WIN:
path = path.replace("\\", "/")
for (url, spec, route_name) in self.registrations:
if WIN:
spec = spec.replace("\\", "/")
if path.startswith(spec):
subpath = path[len(spec):]
if WIN:
subpath = subpath.replace("\\", "/") # windows
if self.cache_busters:
subpath, kw = self._bust_asset_path(
request, spec, subpath, kw)
Expand Down
11 changes: 9 additions & 2 deletions c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ PACKAGE = {{package}}
OPERATING_SYSTEM ?= LINUX

ifeq ($(DEBUG), TRUE)
ifeq ($(OPERATING_SYSTEM), WINDOWS)
PRERULE_CMD ?= @echo "Build $@ due mofification on $?"; ls -lt --reverse $? $@ || true
else
PRERULE_CMD ?= @echo "Build \033[1;34m$@\033[0m due mofification on \033[1;34m$?\033[0m"; ls -lt --reverse $? $@ || true
endif
endif

ifeq ($(OPERATING_SYSTEM), WINDOWS)
VENV_BIN = .build/venv/Scripts
Expand Down Expand Up @@ -158,9 +162,9 @@ GIT_REMOTE ?= origin
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)

# i18n
TX_VERSION = $(shell .build/venv/bin/python -c "print('_'.join(__import__('pkg_resources').get_distribution('c2cgeoportal').version.split('.')[0:2]))")
TX_VERSION = $(shell $(VENV_BIN)/python -c "print('_'.join(__import__('pkg_resources').get_distribution('c2cgeoportal').version.split('.')[0:2]))")
TX_RC = $(HOME_DIR).transifexrc
TX_DEPENDENCIES = $(VENV_BIN)/tx $(TX_RC) .tx/config
TX_DEPENDENCIES = $(VENV_BIN)/tx$(PYTHON_BIN_POSTFIX) $(TX_RC) .tx/config
TX_HOST ?= https://www.transifex.com
ifeq (,$(wildcard $(TX_RC)))
TOUCHBACK_TXRC =
Expand Down Expand Up @@ -691,6 +695,7 @@ $(TX_RC):
.PRECIOUS: .build/locale/%/LC_MESSAGES/gmf.po
.build/locale/%/LC_MESSAGES/gmf.po: $(TX_DEPENDENCIES)
$(PRERULE_CMD)
mkdir -p $(dir $@)
$(VENV_BIN)/tx pull -l $* --force
$(TOUCHBACK_TXRC)

Expand Down Expand Up @@ -857,6 +862,8 @@ $(NPM_CMD):
$(PRERULE_CMD)
ifeq ($(OPERATING_SYSTEM), LINUX)
npm install npm || sleep 20 || npm install npm || sleep 90 || npm install npm
else
touch $@
endif

.build/node_modules.timestamp: package.json $(NPM_CMD)
Expand Down

0 comments on commit 8cfe274

Please sign in to comment.