Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- The MIT License (MIT)
- Copyright (c) 2014 sinfonier-project
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- """
- import basesinfonierbolt
- import requests
- import urllib
- import os
- import csv
- import requests
- import json
- from base64 import b64encode
- def __init__(self):
- basesinfonierbolt.BaseSinfonierBolt().__init__()
- def userprepare(self):
- # catching json_list = vertex, edge and params
- self.json_list = self.getParam("json_list")
- self.name_database = self.getParam("name_database")
- # catching url_database = "url:port". Usually port = 2480
- self.url_database = self.getParam("url_database")
- if self.existsField("user"):
- self.user = self.getParam("user")
- if self.existsField("password"):
- self.password = self.getParam("password")
- def userprocess(self):
- for entity in range (self.json_list):
- self.log("data0 : " + str(entity[0]))
- self.log("data1 : " + str(entity[1]))
- self.log("data2 : " + str(entity[2]))
- self.log("data3 : " + str(entity[3]))
- self.log("data4 : " + str(entity[4]))
- self.log("data5 : " + str(entity[5]))
- self.log("data6 : " + str(entity[6]))
- self.log("data7 : " + str(entity[7]))
- self.log("data8 : " + str(entity[8]))
- self.emit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement