Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F7313225
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/sylk/resources.py b/sylk/resources.py
index c28e5da..66353ad 100644
--- a/sylk/resources.py
+++ b/sylk/resources.py
@@ -1,50 +1,50 @@
import os
import sys
from application.python.descriptor import classproperty
class Resources(object):
"""Provide access to SylkServer's resources"""
_cached_directory = None
@classproperty
def directory(cls):
if cls._cached_directory is None:
binary_directory = os.path.dirname(os.path.realpath(sys.argv[0]))
if os.path.basename(binary_directory) == 'bin':
application_directory = os.path.dirname(binary_directory)
resources_component = 'share/sylkserver'
else:
application_directory = binary_directory
resources_component = 'resources'
cls._cached_directory = os.path.join(application_directory, resources_component)
return cls._cached_directory
@classmethod
def get(cls, resource):
return os.path.join(cls.directory, resource or '')
class VarResources(object):
"""Provide access to SylkServer's resources that should go in /var"""
_cached_directory = None
@classproperty
def directory(cls):
if cls._cached_directory is None:
binary_directory = os.path.dirname(os.path.realpath(sys.argv[0]))
- if os.path.basename(binary_directory) == 'bin':
+ if os.path.basename(binary_directory) == 'bin' and sys.argv[0] != "./sylk-server":
path = '/var'
else:
path = 'var'
cls._cached_directory = os.path.abspath(path)
return cls._cached_directory
@classmethod
def get(cls, resource):
return os.path.join(cls.directory, resource or '')
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Feb 1, 11:04 AM (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3489261
Default Alt Text
(1 KB)
Attached To
Mode
rSYLK SylkServer
Attached
Detach File
Event Timeline
Log In to Comment