Skip to content

Commit

Permalink
FileSystem.FileLastAccessed - saved in JSON format
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Dieckmann committed Jan 14, 2020
1 parent 609e7ff commit e4b01c3
Showing 1 changed file with 173 additions and 36 deletions.
209 changes: 173 additions & 36 deletions nodes/2.x/FileSystem.FileLastAccessed.dyf
Original file line number Diff line number Diff line change
@@ -1,36 +1,173 @@
<Workspace Version="1.3.4.6666" X="219.089711464969" Y="206.93145193315" zoom="1.59077689706107" ScaleFactor="1" Name="FileSystem.FileLastAccessed" Description="Returns the date and time a given file was last accessed" ID="488c904d-d7ae-4c39-b199-ee2d86d5051e" Category="Clockwork.ImportExport.Query">
<NamespaceResolutionMap>
<ClassMap partialName="File" resolvedName="DSCore.IO.File" assemblyName="DSCoreNodes.dll" />
<ClassMap partialName="System.IO.FileInfo" resolvedName="System.IO.FileInfo" assemblyName="" />
</NamespaceResolutionMap>
<Elements>
<PythonNodeModels.PythonNode guid="8a708e01-88d4-4c87-a1e5-9e3cf31c7440" type="PythonNodeModels.PythonNode" nickname="Python Script" x="305.5" y="0" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" inputcount="1">
<PortInfo index="0" default="False" />
<Script>import clr

def FileLastAccessed(file):
if hasattr(file,"LastAccessTime"): return file.LastAccessTime
else: return None

if isinstance(IN[0], list): OUT = [FileLastAccessed(x) for x in IN[0]]
else: OUT = FileLastAccessed(IN[0])</Script>
</PythonNodeModels.PythonNode>
<Dynamo.Graph.Nodes.CustomNodes.Symbol guid="c13766ed-1d87-46b6-88da-95a9fb9ef5e6" type="Dynamo.Graph.Nodes.CustomNodes.Symbol" nickname="Input" x="-80.5" y="0" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="True" IsFrozen="false" isPinned="false">
<Symbol value="file : System.IO.FileInfo[]..[]" />
</Dynamo.Graph.Nodes.CustomNodes.Symbol>
<Dynamo.Graph.Nodes.CustomNodes.Output guid="d15e3067-f552-4f13-8a4c-2511fe85ec9f" type="Dynamo.Graph.Nodes.CustomNodes.Output" nickname="Output" x="529.5" y="0" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false">
<PortInfo index="0" default="False" />
<Symbol value="dateTime" />
</Dynamo.Graph.Nodes.CustomNodes.Output>
</Elements>
<Connectors>
<Dynamo.Graph.Connectors.ConnectorModel start="8a708e01-88d4-4c87-a1e5-9e3cf31c7440" start_index="0" end="d15e3067-f552-4f13-8a4c-2511fe85ec9f" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="c13766ed-1d87-46b6-88da-95a9fb9ef5e6" start_index="0" end="8a708e01-88d4-4c87-a1e5-9e3cf31c7440" end_index="0" portType="0" />
</Connectors>
<Notes />
<Annotations />
<Presets />
<Cameras>
<Camera Name="Hintergrundvorschau" eyeX="-17" eyeY="24" eyeZ="50" lookX="12" lookY="-13" lookZ="-58" upX="0" upY="1" upZ="0" />
</Cameras>
</Workspace>
{
"Uuid": "488c904d-d7ae-4c39-b199-ee2d86d5051e",
"IsCustomNode": true,
"Category": "Clockwork.ImportExport.Query",
"Description": "Returns the date and time a given file was last accessed",
"Name": "FileSystem.FileLastAccessed",
"ElementResolver": {
"ResolutionMap": {
"File": {
"Key": "DSCore.IO.File",
"Value": "DSCoreNodes.dll"
},
"System.IO.FileInfo": {
"Key": "System.IO.FileInfo",
"Value": ""
}
}
},
"Inputs": [],
"Outputs": [],
"Nodes": [
{
"ConcreteType": "PythonNodeModels.PythonNode, PythonNodeModels",
"NodeType": "PythonScriptNode",
"Code": "import clr\r\n\r\ndef FileLastAccessed(file):\r\n\tif hasattr(file,\"LastAccessTime\"): return file.LastAccessTime\r\n\telse: return None\r\n\r\nif isinstance(IN[0], list): OUT = [FileLastAccessed(x) for x in IN[0]]\r\nelse: OUT = FileLastAccessed(IN[0])",
"VariableInputPorts": true,
"Id": "8a708e0188d44c87a1e59e3cf31c7440",
"Inputs": [
{
"Id": "f5707837ec1f4ba38845ae131e515d3e",
"Name": "IN[0]",
"Description": "Input #0",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Outputs": [
{
"Id": "7d3f287d4f58461ab9b117915f0d5a3a",
"Name": "OUT",
"Description": "Ergebnis des Python-Skripts",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Replication": "Disabled",
"Description": "Führt ein eingebettetes IronPython-Skript aus."
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Symbol, DynamoCore",
"NodeType": "InputNode",
"Parameter": {
"Name": "file",
"TypeName": "System.IO.FileInfo",
"TypeRank": -1,
"DefaultValue": null,
"Description": ""
},
"Id": "c13766ed1d8746b688da95a9fb9ef5e6",
"Inputs": [],
"Outputs": [
{
"Id": "b723413bfcea4fe5a6a2fbfba7fa63bc",
"Name": "",
"Description": "Symbol",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Replication": "Disabled",
"Description": "Ein Funktionsparameter zur Verwendung mit benutzerdefinierten Blöcken.\r\n\r\nSie können den Typ und den Vorgabewert für den Parameter angeben, z. B.\r\n\r\ninput : var[]..[]\r\nvalue : bool = false"
},
{
"ConcreteType": "Dynamo.Graph.Nodes.CustomNodes.Output, DynamoCore",
"NodeType": "OutputNode",
"ElementResolver": null,
"Symbol": "dateTime",
"Id": "d15e3067f5524f138a4c2511fe85ec9f",
"Inputs": [
{
"Id": "b5673becdbbf4651aca382fe064b9a94",
"Name": "",
"Description": "",
"UsingDefaultValue": false,
"Level": 2,
"UseLevels": false,
"KeepListStructure": false
}
],
"Outputs": [],
"Replication": "Disabled",
"Description": "Eine Funktionsausgabe zur Verwendung mit benutzerdefinierten Blöcken"
}
],
"Connectors": [
{
"Start": "7d3f287d4f58461ab9b117915f0d5a3a",
"End": "b5673becdbbf4651aca382fe064b9a94",
"Id": "b3e6fed77e984db384b6e54e9398beaf"
},
{
"Start": "b723413bfcea4fe5a6a2fbfba7fa63bc",
"End": "f5707837ec1f4ba38845ae131e515d3e",
"Id": "d165f290e15a41b4b28a17cc4bbeda79"
}
],
"Dependencies": [],
"Bindings": [],
"View": {
"Dynamo": {
"ScaleFactor": 1.0,
"HasRunWithoutCrash": false,
"IsVisibleInDynamoLibrary": true,
"Version": "2.0.3.8810",
"RunType": "Manual",
"RunPeriod": "1000"
},
"Camera": {
"Name": "Hintergrundvorschau",
"EyeX": -17.0,
"EyeY": 24.0,
"EyeZ": 50.0,
"LookX": 12.0,
"LookY": -13.0,
"LookZ": -58.0,
"UpX": 0.0,
"UpY": 1.0,
"UpZ": 0.0
},
"NodeViews": [
{
"ShowGeometry": true,
"Name": "Python Script",
"Id": "8a708e0188d44c87a1e59e3cf31c7440",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Excluded": false,
"X": 305.5,
"Y": 0.0
},
{
"ShowGeometry": true,
"Name": "Input",
"Id": "c13766ed1d8746b688da95a9fb9ef5e6",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Excluded": false,
"X": -80.5,
"Y": 0.0
},
{
"ShowGeometry": true,
"Name": "Output",
"Id": "d15e3067f5524f138a4c2511fe85ec9f",
"IsSetAsInput": false,
"IsSetAsOutput": false,
"Excluded": false,
"X": 529.5,
"Y": 0.0
}
],
"Annotations": [],
"X": 159.47297833131182,
"Y": 263.27413235172287,
"Zoom": 1.7138791189044975
}
}

0 comments on commit e4b01c3

Please sign in to comment.