This commit is contained in:
Liang Ding 2014-12-07 11:12:27 +08:00
parent dfde3ef339
commit aa479f5054
1 changed files with 15 additions and 10 deletions

View File

@ -12,7 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// Configurations manipulations, all configurations (including user configurations) are stored in wide.json. // Package conf includes configurations related manipulations, all configurations (including user configurations) are
// stored in wide.json.
package conf package conf
import ( import (
@ -32,16 +33,20 @@ import (
) )
const ( const (
PathSeparator = string(os.PathSeparator) // OS-specific path separator // PathSeparator holds the OS-specific path separator.
PathListSeparator = string(os.PathListSeparator) // OS-specific path list separator PathSeparator = string(os.PathSeparator)
// PathListSeparator holds the OS-specific path list separator.
PathListSeparator = string(os.PathListSeparator)
) )
const ( const (
WideVersion = "1.0.1" // wide version // WideVersion holds the current wide version.
CodeMirrorVer = "4.8" // editor version WideVersion = "1.0.1"
// CodeMirrorVer holds the current editor version.
CodeMirrorVer = "4.8"
) )
// The latest session content. // LatestSessionContent represents the latest session content.
type LatestSessionContent struct { type LatestSessionContent struct {
FileTree []string // paths of expanding nodes of file tree FileTree []string // paths of expanding nodes of file tree
Files []string // paths of files of opening editor tabs Files []string // paths of files of opening editor tabs
@ -145,13 +150,13 @@ func checkEnv() {
glog.Warningf("Not found gocode [%s]", gocode) glog.Warningf("Not found gocode [%s]", gocode)
} }
ide_stub := util.Go.GetExecutableInGOBIN("ide_stub") ideStub := util.Go.GetExecutableInGOBIN("ide_stub")
cmd = exec.Command(ide_stub, "version") cmd = exec.Command(ideStub, "version")
_, err = cmd.Output() _, err = cmd.Output()
if nil != err { if nil != err {
event.EventQueue <- &event.Event{Code: event.EvtCodeIDEStubNotFound} event.EventQueue <- &event.Event{Code: event.EvtCodeIDEStubNotFound}
glog.Warningf("Not found ide_stub [%s]", ide_stub) glog.Warningf("Not found ide_stub [%s]", ideStub)
} }
} }
@ -359,7 +364,7 @@ func initCustomizedConfs() {
// //
// 1. /static/user/{username}/style.css // 1. /static/user/{username}/style.css
func UpdateCustomizedConf(username string) { func UpdateCustomizedConf(username string) {
var u *User = nil var u *User
for _, user := range Wide.Users { // maybe it is a beauty of the trade-off of the another world between design and implementation for _, user := range Wide.Users { // maybe it is a beauty of the trade-off of the another world between design and implementation
if user.Name == username { if user.Name == username {
u = user u = user