Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python-xstatic
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenStack
xstatic
python-xstatic
Commits
19cd12f0
Commit
19cd12f0
authored
13 years ago
by
Thomas Waldmann
Browse files
Options
Downloads
Patches
Plain Diff
use a module for metadata, not a class, solves import/dependency issue
parent
37c3155a
No related branches found
Branches containing commit
Tags
0.0.2
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+3
-4
3 additions, 4 deletions
setup.py
xstatic/main.py
+6
-5
6 additions, 5 deletions
xstatic/main.py
with
9 additions
and
9 deletions
setup.py
+
3
−
4
View file @
19cd12f0
...
...
@@ -7,16 +7,15 @@ XStatic - setup.py
Works with: setuptools
"""
from
setuptools
import
setup
,
find_packages
# The README.txt file should be written in reST so that PyPI can use
# it to generate your project's PyPI page.
long_description
=
open
(
'
README.txt
'
).
read
()
from
setuptools
import
setup
,
find_packages
setup
(
name
=
'
XStatic
'
,
version
=
'
0.0.
1
'
,
version
=
'
0.0.
2
'
,
description
=
'
XStatic base package with minimal support code
'
,
long_description
=
long_description
,
classifiers
=
[
...
...
@@ -30,7 +29,7 @@ setup(
'
Topic :: System :: Installation/Setup
'
,
'
Topic :: System :: Software Distribution
'
,
],
keywords
=
"
static file resource python packages setuptools pypi require
"
,
keywords
=
"
xstatic
static file resource python packages setuptools pypi require
"
,
author
=
'
Thomas Waldmann
'
,
author_email
=
'
tw@waldmann-edv.de
'
,
url
=
'
http:/bitbucket.org/thomaswaldmann/xstatic
'
,
...
...
This diff is collapsed.
Click to expand it.
xstatic/main.py
+
6
−
5
View file @
19cd12f0
...
...
@@ -10,18 +10,19 @@ class XStatic(object):
minimal support code to access resources from xstatic.pkg.* files
or CDN locations.
"""
name
=
None
# lowercase short name
base_dir
=
None
# fs path to the files
locations
=
{}
# CDN/remote locations
def
__init__
(
self
,
root_url
=
'
/xstatic
'
,
provider
=
'
local
'
,
protocol
=
'
http
'
):
def
__init__
(
self
,
module
,
root_url
=
'
/xstatic
'
,
provider
=
'
local
'
,
protocol
=
'
http
'
):
"""
:arg module: xstatic resource package/module, has metadata as attributes
:arg root_url: the common root url path for all local xstatic
resources
:arg provider:
'
local
'
to get it from local server or
a name of another source (e.g. CDN)
:arg protocol:
'
http
'
(default) or
'
https
'
"""
self
.
__dict__
.
update
([(
name
.
lower
(),
getattr
(
module
,
name
))
for
name
in
dir
(
module
)
if
name
.
isupper
()
])
self
.
provider
=
provider
if
provider
==
'
local
'
:
self
.
base_url
=
"
%s/%s
"
%
(
root_url
,
self
.
name
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment