Commit ae5ace16 authored by zelig's avatar zelig

go fmt

parent 648c418f
package main package main
import ( import (
"bitbucket.org/kardianos/osext"
"flag"
"fmt" "fmt"
"github.com/ethereum/eth-go/ethlog"
"os" "os"
"os/user" "os/user"
"path" "path"
"github.com/ethereum/eth-go/ethlog"
"flag"
"bitbucket.org/kardianos/osext"
"path/filepath" "path/filepath"
"runtime" "runtime"
) )
...@@ -60,8 +60,8 @@ func defaultAssetPath() string { ...@@ -60,8 +60,8 @@ func defaultAssetPath() string {
} }
func defaultDataDir() string { func defaultDataDir() string {
usr, _ := user.Current() usr, _ := user.Current()
return path.Join(usr.HomeDir, ".ethereal") return path.Join(usr.HomeDir, ".ethereal")
} }
var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini") var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini")
......
package main package main
import ( import (
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/ethereal/ui" "github.com/ethereum/go-ethereum/ethereal/ui"
"github.com/ethereum/go-ethereum/utils" "github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/eth-go/ethlog"
"github.com/go-qml/qml" "github.com/go-qml/qml"
"runtime"
"os" "os"
"runtime"
) )
func main() { func main() {
...@@ -32,11 +32,11 @@ func main() { ...@@ -32,11 +32,11 @@ func main() {
ethereum := utils.NewEthereum(UseUPnP, OutboundPort, MaxPeer) ethereum := utils.NewEthereum(UseUPnP, OutboundPort, MaxPeer)
// create, import, export keys // create, import, export keys
utils.KeyTasks(GenAddr, ImportKey, ExportKey, NonInteractive) utils.KeyTasks(GenAddr, ImportKey, ExportKey, NonInteractive)
if ShowGenesis { if ShowGenesis {
utils.ShowGenesis(ethereum) utils.ShowGenesis(ethereum)
} }
if StartRpc { if StartRpc {
utils.StartRpc(ethereum, RpcPort) utils.StartRpc(ethereum, RpcPort)
...@@ -45,17 +45,17 @@ func main() { ...@@ -45,17 +45,17 @@ func main() {
gui := ethui.New(ethereum, LogLevel) gui := ethui.New(ethereum, LogLevel)
utils.RegisterInterrupt(func(os.Signal) { utils.RegisterInterrupt(func(os.Signal) {
gui.Stop() gui.Stop()
}) })
utils.StartEthereum(ethereum, UseSeed) utils.StartEthereum(ethereum, UseSeed)
// gui blocks the main thread // gui blocks the main thread
gui.Start(AssetPath) gui.Start(AssetPath)
// we need to run the interrupt callbacks in case gui is closed // we need to run the interrupt callbacks in case gui is closed
// this skips if we got here by actual interrupt stopping the GUI // this skips if we got here by actual interrupt stopping the GUI
if !interrupted { if !interrupted {
utils.RunInterruptCallbacks(os.Interrupt) utils.RunInterruptCallbacks(os.Interrupt)
} }
// this blocks the thread // this blocks the thread
ethereum.WaitForShutdown() ethereum.WaitForShutdown()
ethlog.Flush() ethlog.Flush()
} }
...@@ -6,9 +6,9 @@ import ( ...@@ -6,9 +6,9 @@ import (
"github.com/ethereum/eth-go" "github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethdb" "github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils" "github.com/ethereum/go-ethereum/utils"
"github.com/go-qml/qml" "github.com/go-qml/qml"
"math/big" "math/big"
...@@ -35,9 +35,9 @@ type Gui struct { ...@@ -35,9 +35,9 @@ type Gui struct {
addr []byte addr []byte
pub *ethpub.PEthereum pub *ethpub.PEthereum
logLevel ethlog.LogLevel logLevel ethlog.LogLevel
open bool open bool
} }
// Create GUI, but doesn't start it // Create GUI, but doesn't start it
......
package main package main
import ( import (
"github.com/ethereum/eth-go" "github.com/ethereum/eth-go"
"github.com/ethereum/go-ethereum/utils" "github.com/ethereum/go-ethereum/utils"
"os" "io/ioutil"
"io/ioutil" "os"
) )
func InitJsConsole(ethereum *eth.Ethereum) { func InitJsConsole(ethereum *eth.Ethereum) {
repl := NewJSRepl(ethereum) repl := NewJSRepl(ethereum)
go repl.Start() go repl.Start()
utils.RegisterInterrupt(func(os.Signal) { utils.RegisterInterrupt(func(os.Signal) {
repl.Stop() repl.Stop()
}) })
} }
func ExecJsFile (ethereum *eth.Ethereum, InputFile string) { func ExecJsFile(ethereum *eth.Ethereum, InputFile string) {
file, err := os.Open(InputFile) file, err := os.Open(InputFile)
if err != nil { if err != nil {
logger.Fatalln(err) logger.Fatalln(err)
} }
content, err := ioutil.ReadAll(file) content, err := ioutil.ReadAll(file)
if err != nil { if err != nil {
logger.Fatalln(err) logger.Fatalln(err)
} }
re := NewJSRE(ethereum) re := NewJSRE(ethereum)
utils.RegisterInterrupt(func(os.Signal) { utils.RegisterInterrupt(func(os.Signal) {
re.Stop() re.Stop()
}) })
re.Run(string(content)) re.Run(string(content))
} }
...@@ -3,10 +3,10 @@ package main ...@@ -3,10 +3,10 @@ package main
import ( import (
"flag" "flag"
"fmt" "fmt"
"github.com/ethereum/eth-go/ethlog"
"os" "os"
"os/user" "os/user"
"path" "path"
"github.com/ethereum/eth-go/ethlog"
) )
var Identifier string var Identifier string
...@@ -34,8 +34,8 @@ var StartJsConsole bool ...@@ -34,8 +34,8 @@ var StartJsConsole bool
var InputFile string var InputFile string
func defaultDataDir() string { func defaultDataDir() string {
usr, _ := user.Current() usr, _ := user.Current()
return path.Join(usr.HomeDir, ".ethereum") return path.Join(usr.HomeDir, ".ethereum")
} }
var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini") var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini")
......
package main package main
import ( import (
"fmt" "fmt"
"github.com/ethereum/eth-go" "github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils" "github.com/ethereum/go-ethereum/utils"
"github.com/obscuren/otto" "github.com/obscuren/otto"
"io/ioutil" "io/ioutil"
......
package main package main
import ( import (
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils"
"runtime" "runtime"
) )
...@@ -24,11 +24,11 @@ func main() { ...@@ -24,11 +24,11 @@ func main() {
ethereum := utils.NewEthereum(UseUPnP, OutboundPort, MaxPeer) ethereum := utils.NewEthereum(UseUPnP, OutboundPort, MaxPeer)
// create, import, export keys // create, import, export keys
utils.KeyTasks(GenAddr, ImportKey, ExportKey, NonInteractive) utils.KeyTasks(GenAddr, ImportKey, ExportKey, NonInteractive)
if ShowGenesis { if ShowGenesis {
utils.ShowGenesis(ethereum) utils.ShowGenesis(ethereum)
} }
if StartMining { if StartMining {
utils.StartMining(ethereum) utils.StartMining(ethereum)
...@@ -48,6 +48,6 @@ func main() { ...@@ -48,6 +48,6 @@ func main() {
utils.StartEthereum(ethereum, UseSeed) utils.StartEthereum(ethereum, UseSeed)
// this blocks the thread // this blocks the thread
ethereum.WaitForShutdown() ethereum.WaitForShutdown()
ethlog.Flush() ethlog.Flush()
} }
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment