Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
w2pext
plugin_dbui
Commits
c8d178c2
Commit
c8d178c2
authored
11 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
Remove the obsolete script cpAdmin.
parent
77fa4b6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cpAdmin
+0
-153
0 additions, 153 deletions
cpAdmin
with
0 additions
and
153 deletions
cpAdmin
deleted
100755 → 0
+
0
−
153
View file @
77fa4b6f
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
NAME
cpAdmin -- copy the web2py admin file in the current application
SYNOPSIS
cpAdmin [options]
DESCRIPTION
Copy or remove the web2py admin file in the current application.
Usefull to fix some problem with the database
EXAMPLES
> cpAdmin -h
> cpAdmin
> cpAdmin --clean
AUTHOR
R. Le Gac, renaud.legac@free.fr
Copyright (c) 2012 R. Le Gac
"""
import
os
import
shutil
import
sys
DIRS
=
[
'
static/css
'
,
'
static/images
'
,
'
static/js
'
]
FILES
=
[
'
controllers/appadmin.py
'
,
'
static/css/anytime.css
'
,
'
static/css/base.css
'
,
'
static/css/handheld.css
'
,
'
static/css/superfish-navbar.css
'
,
'
static/css/superfish-vertical.css
'
,
'
static/css/superfish.css
'
,
'
static/images/arrows-ffffff.png
'
,
'
static/images/css3buttons_backgrounds.png
'
,
'
static/images/css3buttons_icons.png
'
,
'
static/images/poweredby.png
'
,
'
static/images/shadow.png
'
,
'
static/images/ui-icons_222222_256x240.png
'
,
'
static/js/anytime.js
'
,
'
static/js/dd_belatedpng.js
'
,
'
static/js/jquery.js
'
,
'
static/js/modernizr-1.7.min.js
'
,
'
static/js/superfish.js
'
,
'
static/js/web2py_ajax.js
'
,
'
static/favicon.ico
'
,
'
static/favicon.png
'
,
'
views/appadmin.html
'
,
'
views/generic.html
'
,
'
views/generic.json
'
,
'
views/generic.jsonp
'
,
'
views/generic.load
'
,
'
views/generic.pdf
'
,
'
views/generic.rss
'
,
'
views/generic.xml
'
,
'
views/layout.html
'
,
'
views/web2py_ajax.html
'
,]
def
check
():
"""
check that the reference application is there.
"""
path
=
os
.
path
.
join
(
opt
.
web2py
,
opt
.
refapp
)
if
not
os
.
path
.
exists
(
path
):
print
"
\n\t
The reference web2py application foo is missing
"
print
"
\t
Use the option -w to specified another ones.
\n
"
sys
.
exit
(
0
)
def
clean
():
"""
clean admin files.
"""
# remove individual files
for
path
in
FILES
:
if
os
.
path
.
exists
(
path
):
print
"
\r
emoving
"
,
path
os
.
remove
(
path
)
# remove empty directories
for
path
in
DIRS
:
try
:
print
"
\t
removing
"
,
path
os
.
rmdir
(
path
)
except
:
pass
def
copy
():
"""
copy admin files in the current applications
"""
# create directories
for
path
in
DIRS
:
if
not
os
.
path
.
exists
(
path
):
print
"
\t
creating
"
,
path
os
.
mkdir
(
path
)
# copy files from reference applications
for
dest
in
FILES
:
if
not
os
.
path
.
exists
(
dest
):
src
=
os
.
path
.
join
(
opt
.
web2py
,
opt
.
refapp
,
dest
)
print
"
\t
copying
"
,
dest
shutil
.
copy
(
src
,
dest
)
if
__name__
==
'
__main__
'
:
import
optparse
# define script options
ops
=
optparse
.
OptionParser
()
ops
.
add_option
(
"
-c
"
,
"
--clean
"
,
action
=
"
store_true
"
,
dest
=
"
clean
"
,
help
=
"
remove admin files and exit.
"
)
ops
.
add_option
(
"
-r
"
,
"
--reference-application
"
,
dest
=
"
refapp
"
,
help
=
"
name of the reference applications [%default].
"
)
ops
.
add_option
(
"
-w
"
,
"
--web2py
"
,
dest
=
"
web2py
"
,
help
=
"
path to the web2py applications [%default].
"
)
ops
.
set_defaults
(
clean
=
False
,
refapp
=
'
foo
'
,
web2py
=
os
.
path
.
expanduser
(
'
~/myweb/web2py/applications
'
))
(
opt
,
args
)
=
ops
.
parse_args
()
# clean the admin file and exit
if
opt
.
clean
:
print
"
removing admin files...
"
clean
()
print
"
removing is successful !
"
sys
.
exit
(
0
)
# check that reference application exists
# copy admin files from the reference application and exit
check
()
print
"
adding admin files...
"
copy
()
print
"
adding is successful !
"
sys
.
exit
(
0
)
\ No newline at end of file
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