hajoeichler/sphere-stock-xml-import — pull request #7 by emmenko (2014-04-08 22:39:57+00:00)
Title: Sftp

@hajoeichler @svenmueller this is still WIP, but you can already have a look

The script runs, it downloads the files and process them sequentially (see output)

```bash
22:31:14.588Z INFO sphere-stock-xml-import-0.3.5: New connection opened
22:31:14.952Z INFO sphere-stock-xml-import-0.3.5: Downloading files
22:31:15.688Z INFO sphere-stock-xml-import-0.3.5: Closing connection
22:31:15.691Z INFO sphere-stock-xml-import-0.3.5: Processing 2 files... (0=example.csv, 1=example.xml)
22:31:15.692Z INFO sphere-stock-xml-import-0.3.5: 0 'Current tick'
22:31:15.692Z INFO sphere-stock-xml-import-0.3.5: About to process file /Users/nicola/dev/src/sphere-stock-xml-import/tmp/example.csv
22:31:15.697Z INFO sphere-stock-xml-import-0.3.5: File read, running import
22:31:15.701Z INFO sphere-stock-xml-import-0.3.5: [SphereStockImport] Stock entries to process: 3 (widget_type=sphere-node-client)
22:31:17.407Z INFO sphere-stock-xml-import-0.3.5: [SphereStockImport] Existing entries: 4 (widget_type=sphere-node-client)
22:31:17.411Z INFO sphere-stock-xml-import-0.3.5: [SphereStockImport] Requests: 3 (widget_type=sphere-node-client)
22:31:18.269Z INFO sphere-stock-xml-import-0.3.5: (Inventory entry created.=0, Inventory entry updated.=2, Inventory update was not necessary.=1)
22:31:18.270Z INFO sphere-stock-xml-import-0.3.5: Finishing processing file example.csv
22:31:20.018Z INFO sphere-stock-xml-import-0.3.5: New connection opened
22:31:20.018Z INFO sphere-stock-xml-import-0.3.5: Renaming file example.csv on the remote server
22:31:20.195Z INFO sphere-stock-xml-import-0.3.5: 1 'Current tick'
22:31:20.195Z INFO sphere-stock-xml-import-0.3.5: About to process file /Users/nicola/dev/src/sphere-stock-xml-import/tmp/example.xml
22:31:20.198Z INFO sphere-stock-xml-import-0.3.5: File read, running import
22:31:20.515Z INFO sphere-stock-xml-import-0.3.5: [SphereStockImport] Stock entries to process: 2 (widget_type=sphere-node-client)
22:31:20.828Z INFO sphere-stock-xml-import-0.3.5: [SphereStockImport] Existing entries: 4 (widget_type=sphere-node-client)
22:31:20.830Z INFO sphere-stock-xml-import-0.3.5: [SphereStockImport] Requests: 2 (widget_type=sphere-node-client)
22:31:21.257Z INFO sphere-stock-xml-import-0.3.5: (Inventory entry created.=0, Inventory entry updated.=2, Inventory update was not necessary.=0)
22:31:21.257Z INFO sphere-stock-xml-import-0.3.5: Finishing processing file example.xml
22:31:22.941Z INFO sphere-stock-xml-import-0.3.5: New connection opened
22:31:22.941Z INFO sphere-stock-xml-import-0.3.5: Renaming file example.xml on the remote server
22:31:23.118Z INFO sphere-stock-xml-import-0.3.5: 2 'Current tick'
22:31:23.118Z INFO sphere-stock-xml-import-0.3.5: No more files, resolving...
22:31:23.118Z INFO sphere-stock-xml-import-0.3.5: Cleaning tmp folder
```

There is still some refactoring to do and write specs. Will do that tomorrow