Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
cdb549ff
Commit
cdb549ff
authored
Mar 31, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #507: use local files before system wide ones
parent
7e7f2b50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
utils.py
printrun/utils.py
+4
-5
No files found.
printrun/utils.py
View file @
cdb549ff
...
@@ -62,15 +62,14 @@ def imagefile(filename):
...
@@ -62,15 +62,14 @@ def imagefile(filename):
return
os
.
path
.
join
(
"images"
,
filename
)
return
os
.
path
.
join
(
"images"
,
filename
)
def
lookup_file
(
filename
,
prefixes
):
def
lookup_file
(
filename
,
prefixes
):
local_candidate
=
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
filename
)
if
os
.
path
.
exists
(
local_candidate
):
return
local_candidate
for
prefix
in
prefixes
:
for
prefix
in
prefixes
:
candidate
=
os
.
path
.
join
(
prefix
,
filename
)
candidate
=
os
.
path
.
join
(
prefix
,
filename
)
if
os
.
path
.
exists
(
candidate
):
if
os
.
path
.
exists
(
candidate
):
return
candidate
return
candidate
local_candidate
=
os
.
path
.
join
(
os
.
path
.
dirname
(
sys
.
argv
[
0
]),
filename
)
return
filename
if
os
.
path
.
exists
(
local_candidate
):
return
local_candidate
else
:
return
filename
def
pixmapfile
(
filename
):
def
pixmapfile
(
filename
):
return
lookup_file
(
filename
,
[
'/usr/local/share/pixmaps'
,
return
lookup_file
(
filename
,
[
'/usr/local/share/pixmaps'
,
...
...
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