def import_XML(self,XRO):
        name = XRO.name
        self.XRO = XRO
        
        CWO = CSVWriter(XRO)
        print "* Users"
        CWO.write_users(name + "users.csv")        
        self.insert_users_csv(name + "users.csv")
        
        print "* Threads"
        CWO.write_threads(name + "threads.csv")
        self.insert_threads_csv(name + "threads.csv")
        
        print "* Posts"
        CWO.write_posts(name + "posts.csv")
        self.insert_posts_csv(name + "posts.csv")

        print "Writing Indices"
        self.create_indices()
        
        self.reset_cursor()
    def import_XML(self, XRO):
        self.XRO = XRO
        name = XRO.name
        
        CWO = CSVWriter(XRO)

        print "* Wirte CSV"
        CWO.write_nodes(name + "nodes.csv")
        CWO.write_relations(name + "relations.csv")
        CWO.write_thread_index(name + "thread_index.csv")

        self.close()

        print "* Writing Neo4J"
        self.bulk_import(
             nodes_csv = name + "nodes.csv", 
             relations_csv = name + "relations.csv", 
             index_csv = name + "thread_index.csv"
             )
        
        self.open()
Пример #3
0
                    # loop through the numbers in file2array
                    for number in file1ObjectArray:
                        # if the number is in the file1array
                        if number not in file2ObjectArray:
                            # remove all the escape characters using the strip function
                            number = number.strip()
                            # add to the static list
                            PhoneNum.ResultantList.append(number)
                    # check if the file exists wih the name LIST-C in the current directory
                    if (path.exists('LIST-C.csv')):
                        # delete the current directory
                        remove("LIST-C.csv")

                    # create the file
                    fileobj = open("LIST-C.csv", "w+")
                    # close the flle object
                    fileobj.close()

                    #  init the csvwriter object
                    csvobj = CSVWriter(PhoneNum.ResultantList)
                    # write to the resultant file
                    csvobj.writeresultantfile()
                    # display the list
                    csvobj.displayList()
                except FileNotFoundError:
                    print("File Not Found")
    elif (argumentsLength > 3):
        print("Invalid Arguments List Length")
    else:
        print("Less arguments Provided")