Comments (2)
Ah, of course the second I step away for a second I realize what's going on in SFHandlerClass.py:
def getYear(self, datestring):
#sf example: 2016-04-02T20:45:12+13:00
datestring = datestring.replace('Z', '') #TODO: Handle 'Z' (Nato: Zulu) time (ZIPs only?)
dt = datetime.datetime.strptime(datestring.split('+', 1)[0], '%Y-%m-%dT%H:%M:%S')
return int(dt.year)
dt is splitting the time zone info on +, but in this case the timezone code actually starts with a '-', not a '+'.
The following seems to work, although it does introduce another dependency (namely, dateutil.parser):
def getYear(self, datestring):
#sf example: 2016-04-02T20:45:12+13:00
datestring = datestring.replace('Z', '') #TODO: Handle 'Z' (Nato: Zulu) time (ZIPs only?)
dt = dateutil.parser.parse(datestring)
return int(dt.year)
from demystify.
Hi Tim,
Thanks for this! It's great! And thanks for going the extra step of isolating the issue.
Rather than put in another dependency I've opted to create a unit test for two date handling functions, as well as return 'NULL' when there's a problem retrieving the date. At least the script now should output something useful without failing.
I've placed a try/except in the code as well as a final backup of treating the date as a string.
It feels quite hacky and wish Python's native support was stronger but I hope these look okay for you.
Please let me know what you think of the overall output, and performance once you've got it up and running okay.
(I've also spotted an error with the --export flag in droidsqliteanalysis.py at the same time. You can run droidsqliteanalysis.py --export to avoid having to run droid2sqlite.py as well)
Cheers,
Ross
from demystify.
Related Issues (20)
- Feature request: aggregate of non-ASCII/system file/directory characters HOT 1
- Incorporate demystify-lite changes HOT 1
- Consider a citation file...
- Using a siegfried export throws an error HOT 3
- Enable classification in results HOT 1
- Allow users to inspect the sqlite queries used HOT 1
- create_id_breakdown is a bottleneck and needs rewriting HOT 1
- Grafana for visualisation of database?
- Remove version string from pathlesstaken HOT 2
- Need a new concept for configuration HOT 4
- MacOS resource forks
- Pyscript or Pyodide this? HOT 3
- Report on how many dotfiles/resource forks HOT 1
- Piping to file on windows produces charmap errors HOT 6
- installation instructions updates HOT 3
- Remove "PY3" check and bool HOT 1
- Issues with Siegfried output - directories and None ID
- Gnarly data still causes problems (DROID CSV)
- Don't finish on analysis complete when an analysis hasn't worked, eg. Export not identified HOT 1
- YAML may be malformed, or contain unexpected information HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from demystify.